mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-24 22:12:00 +00:00
fix: OTP_IN_RADIUS 与 mfa 冲突
This commit is contained in:
parent
fc8181b5ed
commit
09d51fd5be
@ -346,6 +346,10 @@ class AuthMixin(PasswordEncryptionViewMixin):
|
||||
def check_user_mfa_if_need(self, user):
|
||||
if self.request.session.get('auth_mfa'):
|
||||
return
|
||||
|
||||
if settings.OTP_IN_RADIUS:
|
||||
return
|
||||
|
||||
if not user.mfa_enabled:
|
||||
return
|
||||
unset, url = user.mfa_enabled_but_not_set()
|
||||
|
@ -14,7 +14,8 @@ from .signals import post_auth_success, post_auth_failed
|
||||
@receiver(user_logged_in)
|
||||
def on_user_auth_login_success(sender, user, request, **kwargs):
|
||||
# 开启了 MFA,且没有校验过
|
||||
if user.mfa_enabled and not request.session.get('auth_mfa'):
|
||||
|
||||
if user.mfa_enabled and not settings.OTP_IN_RADIUS and not request.session.get('auth_mfa'):
|
||||
request.session['auth_mfa_required'] = 1
|
||||
|
||||
if settings.USER_LOGIN_SINGLE_MACHINE_ENABLED:
|
||||
|
Loading…
Reference in New Issue
Block a user