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

@ -6,13 +6,13 @@
"notification_name": "One-Time Passcode",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",
"user_email": "bobby@coder.com",
"user_email": "bobby/drop-table+user@coder.com",
"user_name": "Bobby",
"user_username": "bobby",
"actions": [
{
"label": "Reset password",
"url": "http://test.com/reset-password/change?otp=00000000-0000-0000-0000-000000000000\u0026email=bobby@coder.com"
"url": "http://test.com/reset-password/change?otp=00000000-0000-0000-0000-000000000000\u0026email=bobby%2Fdrop-table%2Buser%40coder.com"
}
],
"labels": {