Fix MFA prompt not being shown for hardened mode (#10455)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
921504483b
Коммит
eb49713c96
@@ -1109,9 +1109,10 @@ func sendPasswordReset(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func login(c *Context, w http.ResponseWriter, r *http.Request) {
|
func login(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||||
// For hardened mode, translate all login errors to generic.
|
// For hardened mode, translate all login errors to generic. MFA error being an exception, since it's required for
|
||||||
|
// the login flow itself.
|
||||||
defer func() {
|
defer func() {
|
||||||
if *c.App.Config().ServiceSettings.ExperimentalEnableHardenedMode && c.Err != nil {
|
if *c.App.Config().ServiceSettings.ExperimentalEnableHardenedMode && c.Err != nil && c.Err.Id != "mfa.validate_token.authenticate.app_error" {
|
||||||
c.Err = model.NewAppError("login", "api.user.login.invalid_credentials", nil, "", http.StatusUnauthorized)
|
c.Err = model.NewAppError("login", "api.user.login.invalid_credentials", nil, "", http.StatusUnauthorized)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user