feat(security): #286 fix mail sending
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 46s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 50s

This commit was merged in pull request #300.
This commit is contained in:
2024-12-09 23:19:51 +01:00
parent eab42c26f8
commit 8cf2210aaf
5 changed files with 76 additions and 32 deletions

View File

@@ -220,7 +220,7 @@ func (service AuthImpl) SignUp(email string, password string) (*User, error) {
func (service AuthImpl) SendVerificationMail(userId uuid.UUID, email string) {
tokens, err := service.db.GetTokensByUserIdAndType(userId, db.TokenTypeEmailVerify)
if err != nil {
if err != nil && err != db.ErrNotFound {
return
}
@@ -304,7 +304,7 @@ func (service AuthImpl) DeleteAccount(user *User) error {
return err
}
go service.mail.SendMail(user.Email, "Account deleted", "Your account has been deleted")
service.mail.SendMail(user.Email, "Account deleted", "Your account has been deleted")
return nil
}
@@ -370,7 +370,7 @@ func (service AuthImpl) SendForgotPasswordMail(email string) error {
log.Error("Could not render reset password email: %v", err)
return types.ErrInternal
}
go service.mail.SendMail(email, "Reset Password", mail.String())
service.mail.SendMail(email, "Reset Password", mail.String())
return nil
}