From ac1784172128aacb7b7b68a227888d66108e2e4a Mon Sep 17 00:00:00 2001 From: James Elliott Date: Mon, 2 Aug 2021 16:54:20 +1000 Subject: [PATCH] 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. --- internal/handlers/const.go | 1 - internal/handlers/handler_firstfactor.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/handlers/const.go b/internal/handlers/const.go index 4502e5c9..576327eb 100644 --- a/internal/handlers/const.go +++ b/internal/handlers/const.go @@ -39,7 +39,6 @@ const ( const ( messageOperationFailed = "Operation failed." messageAuthenticationFailed = "Authentication failed. Check your credentials." - messageUserBanned = "Please retry in a few minutes." messageUnableToRegisterOneTimePassword = "Unable to set up one-time passwords." //nolint:gosec messageUnableToRegisterSecurityKey = "Unable to register your security key." messageUnableToResetPassword = "Unable to reset your password." diff --git a/internal/handlers/handler_firstfactor.go b/internal/handlers/handler_firstfactor.go index f8391964..84181376 100644 --- a/internal/handlers/handler_firstfactor.go +++ b/internal/handlers/handler_firstfactor.go @@ -81,7 +81,7 @@ func FirstFactorPost(msInitialDelay time.Duration, delayEnabled bool) middleware if err != nil { 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 }