diff --git a/account/account.go b/account/account.go index d4c6c1c..a6c24b0 100644 --- a/account/account.go +++ b/account/account.go @@ -182,8 +182,15 @@ func (s AccountServiceDefault) VerifyEmail(email string, token string) error { } } - return nil + verification = models.EmailVerification{ + UserID: verification.UserID, + } + if result := s.db.Where(&verification).Delete(&verification); result.Error != nil { + return NewAccountError(ErrKeyDatabaseOperationFailed, result.Error) + } + + return nil } func (s AccountServiceDefault) UpdateAccountName(userId uint, firstName string, lastName string) error {