fix: only update user if we aren't yet verified
This commit is contained in:
parent
b3d63007e1
commit
5c6224222f
|
@ -159,9 +159,11 @@ func (s AccountServiceDefault) VerifyEmail(email string, token string) error {
|
||||||
return NewAccountError(ErrKeySecurityInvalidToken, nil)
|
return NewAccountError(ErrKeySecurityInvalidToken, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
err := s.updateAccountInfo(verification.UserID, models.User{Verified: true})
|
if !verification.User.Verified {
|
||||||
if err != nil {
|
err := s.updateAccountInfo(verification.UserID, models.User{Verified: true})
|
||||||
return err
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue