From f64f8625f10daffaf2dcd6678a0b0cf337883449 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Fri, 5 Sep 2025 01:00:14 +0200 Subject: [PATCH] Add username to password recovey emails --- server/src/auth_service.rs | 1 + server/src/mail.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/auth_service.rs b/server/src/auth_service.rs index 5bdcbb2..8bed544 100644 --- a/server/src/auth_service.rs +++ b/server/src/auth_service.rs @@ -189,6 +189,7 @@ where user.display_name .as_deref() .unwrap_or_else(|| user.user_id.as_str()), + user.user_id.as_str(), user.email.as_str(), &token, &data.server_url, diff --git a/server/src/mail.rs b/server/src/mail.rs index f0b2463..492c152 100644 --- a/server/src/mail.rs +++ b/server/src/mail.rs @@ -80,6 +80,7 @@ async fn send_email( } pub async fn send_password_reset_email( + display_name: &str, username: &str, to: &str, token: &str, @@ -93,7 +94,10 @@ pub async fn send_password_reset_email( .unwrap() .extend(["reset-password", "step2", token]); let body = format!( - "Hello {username}, + "Hello {display_name}, + +Your username is: \"{username}\" + This email has been sent to you in order to validate your identity. If you did not initiate the process your credentials might have been compromised. You should reset your password and contact an administrator.