Revert "fix: add error for email verification"
This reverts commit ea5a97c6
This commit is contained in:
parent
501de26793
commit
adc5bc213e
|
@ -202,7 +202,7 @@ func (s AccountServiceDefault) VerifyEmail(email string, token string) error {
|
||||||
|
|
||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
||||||
return NewAccountError(ErrKeyEmailVerificationFailed, nil)
|
return NewAccountError(ErrKeyUserNotFound, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
return NewAccountError(ErrKeyDatabaseOperationFailed, result.Error)
|
return NewAccountError(ErrKeyDatabaseOperationFailed, result.Error)
|
||||||
|
|
|
@ -27,7 +27,6 @@ const (
|
||||||
// Account update errors
|
// Account update errors
|
||||||
ErrKeyAccountUpdateFailed = "ErrAccountUpdateFailed"
|
ErrKeyAccountUpdateFailed = "ErrAccountUpdateFailed"
|
||||||
ErrKeyAccountAlreadyVerified = "ErrAccountAlreadyVerified"
|
ErrKeyAccountAlreadyVerified = "ErrAccountAlreadyVerified"
|
||||||
ErrKeyEmailVerificationFailed = "ErrEmailVerificationFailed"
|
|
||||||
|
|
||||||
// JWT generation errors
|
// JWT generation errors
|
||||||
ErrKeyJWTGenerationFailed = "ErrJWTGenerationFailed"
|
ErrKeyJWTGenerationFailed = "ErrJWTGenerationFailed"
|
||||||
|
@ -76,7 +75,6 @@ var defaultErrorMessages = map[string]string{
|
||||||
// Account update errors
|
// Account update errors
|
||||||
ErrKeyAccountUpdateFailed: "Failed to update account information.",
|
ErrKeyAccountUpdateFailed: "Failed to update account information.",
|
||||||
ErrKeyAccountAlreadyVerified: "Account is already verified.",
|
ErrKeyAccountAlreadyVerified: "Account is already verified.",
|
||||||
ErrKeyEmailVerificationFailed: "Failed to verify email address.",
|
|
||||||
|
|
||||||
// JWT generation errors
|
// JWT generation errors
|
||||||
ErrKeyJWTGenerationFailed: "Failed to generate a new JWT token.",
|
ErrKeyJWTGenerationFailed: "Failed to generate a new JWT token.",
|
||||||
|
@ -124,7 +122,6 @@ var (
|
||||||
// Account update errors
|
// Account update errors
|
||||||
ErrKeyAccountUpdateFailed: http.StatusInternalServerError,
|
ErrKeyAccountUpdateFailed: http.StatusInternalServerError,
|
||||||
ErrKeyAccountAlreadyVerified: http.StatusConflict,
|
ErrKeyAccountAlreadyVerified: http.StatusConflict,
|
||||||
ErrKeyEmailVerificationFailed: http.StatusInternalServerError,
|
|
||||||
|
|
||||||
// JWT generation errors
|
// JWT generation errors
|
||||||
ErrKeyJWTGenerationFailed: http.StatusInternalServerError,
|
ErrKeyJWTGenerationFailed: http.StatusInternalServerError,
|
||||||
|
|
Loading…
Reference in New Issue