-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backend: send email on password reset
- Loading branch information
1 parent
07fb2cc
commit 3b3c6a9
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,6 +194,14 @@ func (s *Handler) ResetPasswordRoute(w http.ResponseWriter, r *http.Request) { | |
return | ||
} | ||
|
||
// Send confirmation email | ||
messageBody := fmt.Sprintf("Your password has been successfully reset. If you did not request this change, please contact [email protected] immediately.") | ||
err = s.Server.Mail.SendEmail("Password Reset Confirmation", user.Email, messageBody) | ||
if err != nil { | ||
// Log the error but don't return it to the user since the password was successfully reset | ||
log.Printf("Error sending password reset confirmation email: %v", err) | ||
} | ||
|
||
response := models.ResetPasswordResponse{ | ||
Message: "Your password has been updated", | ||
} | ||
|