fix: only update user if we aren't yet verified
This commit is contained in:
parent
b3d63007e1
commit
5c6224222f
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue