feat: add checkOrgMasterVerificationCode()

This commit is contained in:
hsluoyz
2025-02-06 23:46:22 +08:00
parent 3b9e08b70d
commit b3526de675
3 changed files with 63 additions and 10 deletions

View File

@ -910,11 +910,20 @@ func (c *ApiController) Login() {
return
}
err = mfaUtil.Verify(authForm.Passcode)
passed, err := c.checkOrgMasterVerificationCode(user, authForm.Passcode)
if err != nil {
c.ResponseError(err.Error())
return
}
if !passed {
err = mfaUtil.Verify(authForm.Passcode)
if err != nil {
c.ResponseError(err.Error())
return
}
}
c.SetSession("verificationCodeType", "")
} else if authForm.RecoveryCode != "" {
err = object.MfaRecover(user, authForm.RecoveryCode)