From 9424929dde4c6fd0ac905a161dfab387efc40b6c Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Tue, 19 Oct 2021 20:20:56 +0800 Subject: [PATCH] fix: sms bug --- apps/authentication/mixins.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/authentication/mixins.py b/apps/authentication/mixins.py index a32ee6b81..843bf8ede 100644 --- a/apps/authentication/mixins.py +++ b/apps/authentication/mixins.py @@ -401,9 +401,9 @@ class AuthMixin(PasswordEncryptionViewMixin): def check_user_mfa(self, code, mfa_type=MFAType.OTP, user=None): user = user if user else self.get_user_from_session() if not user.mfa_enabled: - return True + return - if not (bool(user.otp_secret_key) and mfa_type == MFAType.OTP): + if not bool(user.otp_secret_key) and mfa_type == MFAType.OTP: self.set_passwd_verify_on_session(user) raise errors.OTPRequiredError(reverse_lazy('authentication:user-otp-enable-bind'))