feat: allow disabling the mfa setup prompt (#4575)

* feat: allow disabling the mfa setup prompt

* e2e: disable mfa prompt

Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
Livio Spring
2022-10-26 10:20:01 +02:00
committed by GitHub
parent 224f8e851c
commit 27e7dc68a8
4 changed files with 40 additions and 26 deletions

View File

@@ -1106,6 +1106,9 @@ func (repo *AuthRequestRepo) mfaSkippedOrSetUp(user *user_model.UserView, reques
if user.MFAMaxSetUp > domain.MFALevelNotSetUp {
return true
}
if request.LoginPolicy.MFAInitSkipLifetime == 0 {
return true
}
return checkVerificationTime(user.MFAInitSkipped, request.LoginPolicy.MFAInitSkipLifetime)
}