1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-31 06:40:39 +00:00

pass 2fa for sso user (#5400)

This commit is contained in:
lian 2023-03-15 11:43:31 +08:00 committed by GitHub
parent 988bedbdb9
commit bc7494b94b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,8 +89,8 @@ class ForceTwoFactorAuthMiddleware(MiddlewareMixin):
if user.otp_device is not None:
return None
if ENABLE_FORCE_2FA_TO_ALL_USERS or UserOptions.objects.is_force_2fa(user.username):
if (ENABLE_FORCE_2FA_TO_ALL_USERS or UserOptions.objects.is_force_2fa(user.username)) \
and not request.session.get('is_sso_user'):
return HttpResponseRedirect(reverse('two_factor:setup'))
return None