fix: 修复配置mfa失效日期 失效问题 (#8856)

Co-authored-by: feng626 <1304903146@qq.com>
pull/8858/head
fit2bot 2 years ago committed by GitHub
parent 93e1adf376
commit 5e16b6387a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -70,7 +70,8 @@ class UserConfirmation(permissions.BasePermission):
return True
@classmethod
def require(cls, confirm_type=ConfirmType.ReLogin, ttl=300):
def require(cls, confirm_type=ConfirmType.ReLogin, ttl=60 * 5):
min_level = ConfirmType.values.index(confirm_type) + 1
ttl = settings.SECURITY_MFA_VERIFY_TTL if confirm_type == ConfirmType.MFA else ttl
name = 'UserConfirmationLevel{}TTL{}'.format(min_level, ttl)
return type(name, (cls,), {'min_level': min_level, 'ttl': ttl, 'confirm_type': confirm_type})

Loading…
Cancel
Save