diff --git a/apps/authentication/forms.py b/apps/authentication/forms.py index bd7fa7d67..e80407d15 100644 --- a/apps/authentication/forms.py +++ b/apps/authentication/forms.py @@ -5,7 +5,7 @@ from django.conf import settings from django.utils.translation import ugettext_lazy as _ from captcha.fields import CaptchaField, CaptchaTextInput -from common.utils import get_logger, rsa_decrypt_by_session_pkey +from common.utils import get_logger, decrypt_password logger = get_logger(__name__) @@ -13,7 +13,7 @@ logger = get_logger(__name__) class EncryptedField(forms.CharField): def to_python(self, value): value = super().to_python(value) - return rsa_decrypt_by_session_pkey(value) + return decrypt_password(value) class UserLoginForm(forms.Form): diff --git a/apps/authentication/mixins.py b/apps/authentication/mixins.py index 698601d4c..2f4f1d6e0 100644 --- a/apps/authentication/mixins.py +++ b/apps/authentication/mixins.py @@ -56,6 +56,7 @@ def authenticate(request=None, **credentials): for backend, backend_path in _get_backends(return_tuples=True): # 检查用户名是否允许认证 (预先检查,不浪费认证时间) + logger.info('Try using auth backend: {}'.format(str(backend))) if not backend.username_allow_authenticate(username): continue diff --git a/apps/authentication/templates/authentication/login.html b/apps/authentication/templates/authentication/login.html index 477df7af4..823f22201 100644 --- a/apps/authentication/templates/authentication/login.html +++ b/apps/authentication/templates/authentication/login.html @@ -241,6 +241,8 @@ {% include '_foot_js.html' %} + +