fix: urlencode email in reset password link (#15167)

Fixes https://github.com/coder/coder/issues/15151

This runs `urlencode` (provided by `text/template`) on the email address
in the link. This ensures the link will work if a user has an email in
the form `user+label@example.com`.
This commit is contained in:
Danielle Maywood
2024-10-21 16:09:59 +01:00
committed by GitHub
parent 13f6645ab9
commit 23f61c68b4
5 changed files with 19 additions and 8 deletions

View File

@ -994,7 +994,7 @@ func TestNotificationTemplates_Golden(t *testing.T) {
id: notifications.TemplateUserRequestedOneTimePasscode,
payload: types.MessagePayload{
UserName: "Bobby",
UserEmail: "bobby@coder.com",
UserEmail: "bobby/drop-table+user@coder.com",
UserUsername: "bobby",
Labels: map[string]string{
"one_time_passcode": "fad9020b-6562-4cdb-87f1-0486f1bea415",