refactor: use ErrKeySecurityInvalidToken

This commit is contained in:
Derrick Hammer 2024-03-26 20:25:32 -04:00
parent adc5bc213e
commit 0a5e52ec16
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -202,10 +202,10 @@ func (s AccountServiceDefault) VerifyEmail(email string, token string) error {
if result.Error != nil {
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
return NewAccountError(ErrKeyUserNotFound, nil)
return NewAccountError(ErrKeySecurityInvalidToken, nil)
}
return NewAccountError(ErrKeyDatabaseOperationFailed, result.Error)
return NewAccountError(ErrKeyDatabaseOperationFailed, nil)
}
if verification.ExpiresAt.Before(time.Now()) {