diff --git a/common/auth.py b/common/auth.py index 540fafc405..f26e081c84 100644 --- a/common/auth.py +++ b/common/auth.py @@ -109,33 +109,23 @@ def authenticate_entry(request): if SysConfig().get('enforce_2fa'): # 用户是否配置过2fa if twofa_enabled: - auth_type = twofa_enabled[0].auth_type - phone = twofa_enabled[0].phone verify_mode = 'verify_only' else: - auth_type = 'totp' - phone = '' verify_mode = 'verify_config' # 设置无登录状态session s = SessionStore() s['user'] = authenticated_user.username - s['auth_type'] = auth_type s['verify_mode'] = verify_mode - s['phone'] = phone s.set_expiry(300) s.create() result = {'status': 0, 'msg': 'ok', 'data': s.session_key} else: # 用户是否配置过2fa if twofa_enabled: - auth_type = twofa_enabled[0].auth_type - phone = twofa_enabled[0].phone # 设置无登录状态session s = SessionStore() s['user'] = authenticated_user.username - s['auth_type'] = auth_type s['verify_mode'] = 'verify_only' - s['phone'] = phone s.set_expiry(300) s.create() result = {'status': 0, 'msg': 'ok', 'data': s.session_key} diff --git a/common/templates/2fa.html b/common/templates/2fa.html index 0515e7ce17..b4b22d14a2 100644 --- a/common/templates/2fa.html +++ b/common/templates/2fa.html @@ -27,7 +27,7 @@