[MM-14081] Disable checkMFA Endpoint by default and add tests for MFA login (#10356)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6a3fdbd489
Коммит
dcf611b735
@@ -53,8 +53,12 @@ func (a *App) CheckPasswordAndAllCriteria(user *model.User, password string, mfa
|
||||
}
|
||||
|
||||
if err := a.CheckUserMfa(user, mfaToken); err != nil {
|
||||
if result := <-a.Srv.Store.User().UpdateFailedPasswordAttempts(user.Id, user.FailedAttempts+1); result.Err != nil {
|
||||
return result.Err
|
||||
// If the mfaToken is not set, we assume the client used this as a pre-flight request to query the server
|
||||
// about the MFA state of the user in question
|
||||
if mfaToken != "" {
|
||||
if result := <-a.Srv.Store.User().UpdateFailedPasswordAttempts(user.Id, user.FailedAttempts+1); result.Err != nil {
|
||||
return result.Err
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user