diff --git a/ckanext-hdx_users/ckanext/hdx_users/views/signin.py b/ckanext-hdx_users/ckanext/hdx_users/views/signin.py index 617c47ad90..ca91cfde99 100644 --- a/ckanext-hdx_users/ckanext/hdx_users/views/signin.py +++ b/ckanext-hdx_users/ckanext/hdx_users/views/signin.py @@ -1,6 +1,6 @@ from typing import Union, Any, Optional, Mapping from urllib.parse import quote - +import logging from flask import Blueprint, Response from ckan.common import session @@ -18,6 +18,8 @@ hdx_signin = Blueprint(u'hdx_signin', __name__, url_prefix=u'/') +log = logging.getLogger(__name__) + abort = tk.abort render = tk.render request = tk.request @@ -130,9 +132,11 @@ def login() -> Union[Response, str]: session['from_login'] = True res = next_page_or_default(next) _remember_user_for_next_signin(res, user_obj) + log.warning(f'Login succeeded for: {username_or_email}') return res else: extra_vars['error_message'] = _(u"Login failed. Bad username or password.") + log.warning(f'Login failed for: {username_or_email} . Bad username or password.') return render("user/signin.html", extra_vars=extra_vars) info_message_type = request.args.get('info_message_type')