fix(handlers): make user banned message consistent (#2223)

This is so the user banned API message is consistent with other authentication failed messages, even in the API.
pull/2209/head^2
James Elliott 2021-08-02 16:54:20 +10:00 committed by GitHub
parent bc983ce9f5
commit ac17841721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -39,7 +39,6 @@ const (
const ( const (
messageOperationFailed = "Operation failed." messageOperationFailed = "Operation failed."
messageAuthenticationFailed = "Authentication failed. Check your credentials." messageAuthenticationFailed = "Authentication failed. Check your credentials."
messageUserBanned = "Please retry in a few minutes."
messageUnableToRegisterOneTimePassword = "Unable to set up one-time passwords." //nolint:gosec messageUnableToRegisterOneTimePassword = "Unable to set up one-time passwords." //nolint:gosec
messageUnableToRegisterSecurityKey = "Unable to register your security key." messageUnableToRegisterSecurityKey = "Unable to register your security key."
messageUnableToResetPassword = "Unable to reset your password." messageUnableToResetPassword = "Unable to reset your password."

View File

@ -81,7 +81,7 @@ func FirstFactorPost(msInitialDelay time.Duration, delayEnabled bool) middleware
if err != nil { if err != nil {
if err == regulation.ErrUserIsBanned { if err == regulation.ErrUserIsBanned {
handleAuthenticationUnauthorized(ctx, fmt.Errorf("User %s is banned until %s", bodyJSON.Username, bannedUntil), messageUserBanned) handleAuthenticationUnauthorized(ctx, fmt.Errorf("User %s is banned until %s", bodyJSON.Username, bannedUntil), messageAuthenticationFailed)
return return
} }