fix: sms bug

pull/6963/head
feng626 2021-10-19 20:20:56 +08:00 committed by 老广
parent b95d3ac9be
commit 9424929dde
1 changed files with 2 additions and 2 deletions

View File

@ -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'))