refactor: delete all the users email verifications after a successful verification
This commit is contained in:
parent
036520581f
commit
92c33e0af5
|
@ -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 {
|
func (s AccountServiceDefault) UpdateAccountName(userId uint, firstName string, lastName string) error {
|
||||||
|
|
Loading…
Reference in New Issue