From 19799351dbe3a8108543c0c3b92c4c7ded9352a7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Sep 2025 20:37:24 +0000 Subject: [PATCH] Implement username recovery in password reset emails Co-authored-by: nitnelave <796633+nitnelave@users.noreply.github.com> --- server/src/auth_service.rs | 4 +--- server/src/mail.rs | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/auth_service.rs b/server/src/auth_service.rs index 5bdcbb2..0f799e8 100644 --- a/server/src/auth_service.rs +++ b/server/src/auth_service.rs @@ -186,9 +186,7 @@ where Some(token) => token, }; if let Err(e) = super::mail::send_password_reset_email( - 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..d18b4f6 100644 --- a/server/src/mail.rs +++ b/server/src/mail.rs @@ -93,11 +93,13 @@ pub async fn send_password_reset_email( .unwrap() .extend(["reset-password", "step2", token]); let body = format!( - "Hello {username}, + "Hello, 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. +Your username is: {username} + To reset your password please visit the following URL: {reset_url} Please contact an administrator if you did not initiate the process."