fix: only update user if we aren't yet verified

This commit is contained in:
Derrick Hammer 2024-02-26 10:30:22 -05:00
parent b3d63007e1
commit 5c6224222f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 3 deletions

View File

@ -159,10 +159,12 @@ func (s AccountServiceDefault) VerifyEmail(email string, token string) error {
return NewAccountError(ErrKeySecurityInvalidToken, nil) return NewAccountError(ErrKeySecurityInvalidToken, nil)
} }
if !verification.User.Verified {
err := s.updateAccountInfo(verification.UserID, models.User{Verified: true}) err := s.updateAccountInfo(verification.UserID, models.User{Verified: true})
if err != nil { if err != nil {
return err return err
} }
}
return nil return nil