fix: 如配置SECURITY_VIEW_AUTH_NEED_MFA 跳过校验

pull/8622/head
feng626 2022-07-19 16:22:49 +08:00 committed by Jiangjie.Bai
parent cc2b858769
commit 358460e7f0
1 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,9 @@ class UserConfirmation(permissions.BasePermission):
confirm_type = ConfirmType.ReLogin
def has_permission(self, request, view):
if not settings.SECURITY_VIEW_AUTH_NEED_MFA:
return True
confirm_level = request.session.get('CONFIRM_LEVEL')
confirm_time = request.session.get('CONFIRM_TIME')