From adc5bc213e9300a429f48b60292af09daed8e9aa Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 26 Mar 2024 20:24:55 -0400 Subject: [PATCH] Revert "fix: add error for email verification" This reverts commit ea5a97c6 --- account/account.go | 2 +- account/errors.go | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/account/account.go b/account/account.go index 86535f3..9f9becd 100644 --- a/account/account.go +++ b/account/account.go @@ -202,7 +202,7 @@ func (s AccountServiceDefault) VerifyEmail(email string, token string) error { if result.Error != nil { if errors.Is(result.Error, gorm.ErrRecordNotFound) { - return NewAccountError(ErrKeyEmailVerificationFailed, nil) + return NewAccountError(ErrKeyUserNotFound, nil) } return NewAccountError(ErrKeyDatabaseOperationFailed, result.Error) diff --git a/account/errors.go b/account/errors.go index 406eeb7..3076715 100644 --- a/account/errors.go +++ b/account/errors.go @@ -25,9 +25,8 @@ const ( ErrKeyHashingFailed = "ErrHashingFailed" // Account update errors - ErrKeyAccountUpdateFailed = "ErrAccountUpdateFailed" - ErrKeyAccountAlreadyVerified = "ErrAccountAlreadyVerified" - ErrKeyEmailVerificationFailed = "ErrEmailVerificationFailed" + ErrKeyAccountUpdateFailed = "ErrAccountUpdateFailed" + ErrKeyAccountAlreadyVerified = "ErrAccountAlreadyVerified" // JWT generation errors ErrKeyJWTGenerationFailed = "ErrJWTGenerationFailed" @@ -74,9 +73,8 @@ var defaultErrorMessages = map[string]string{ ErrKeyLoginFailed: "Login failed due to an internal error.", // Account update errors - ErrKeyAccountUpdateFailed: "Failed to update account information.", - ErrKeyAccountAlreadyVerified: "Account is already verified.", - ErrKeyEmailVerificationFailed: "Failed to verify email address.", + ErrKeyAccountUpdateFailed: "Failed to update account information.", + ErrKeyAccountAlreadyVerified: "Account is already verified.", // JWT generation errors ErrKeyJWTGenerationFailed: "Failed to generate a new JWT token.", @@ -122,9 +120,8 @@ var ( ErrKeyLoginFailed: http.StatusInternalServerError, // Account update errors - ErrKeyAccountUpdateFailed: http.StatusInternalServerError, - ErrKeyAccountAlreadyVerified: http.StatusConflict, - ErrKeyEmailVerificationFailed: http.StatusInternalServerError, + ErrKeyAccountUpdateFailed: http.StatusInternalServerError, + ErrKeyAccountAlreadyVerified: http.StatusConflict, // JWT generation errors ErrKeyJWTGenerationFailed: http.StatusInternalServerError,