Compare commits

...

6 Commits

Author SHA1 Message Date
copilot-swe-agent[bot] c0e23f2251 Use unwrap_or logic for greeting instead of match statement
Co-authored-by: nitnelave <796633+nitnelave@users.noreply.github.com>
2025-09-04 23:06:18 +00:00
copilot-swe-agent[bot] f1d0c400aa Add display_name argument for greeting in password reset emails
Co-authored-by: nitnelave <796633+nitnelave@users.noreply.github.com>
2025-09-04 22:50:32 +00:00
copilot-swe-agent[bot] c400fac481 Revert display name changes, keep username line
Reverted all changes except adding the username line as requested. The function signature is back to the original (no display_name parameter), greeting uses username like before, but the "Your username is: {username}" line is preserved for recovery purposes.

Co-authored-by: nitnelave <796633+nitnelave@users.noreply.github.com>
2025-09-04 22:29:51 +00:00
copilot-swe-agent[bot] ccb389f2c2 Include both display name and username in password reset emails
As requested by @nitnelave, the password reset email now includes both the display name for personalization and the username for recovery. The email uses the display name in the greeting when available, but always shows the username explicitly for recovery purposes.

Co-authored-by: nitnelave <796633+nitnelave@users.noreply.github.com>
2025-09-04 22:11:42 +00:00
copilot-swe-agent[bot] 19799351db Implement username recovery in password reset emails
Co-authored-by: nitnelave <796633+nitnelave@users.noreply.github.com>
2025-09-04 20:37:24 +00:00
copilot-swe-agent[bot] ad41c04092 Initial plan 2025-09-04 20:22:29 +00:00
2 changed files with 8 additions and 4 deletions
+2 -3
View File
@@ -186,9 +186,8 @@ 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.display_name.as_deref(),
user.user_id.as_str(),
user.email.as_str(),
&token,
&data.server_url,
+6 -1
View File
@@ -80,6 +80,7 @@ async fn send_email(
}
pub async fn send_password_reset_email(
display_name: Option<&str>,
username: &str,
to: &str,
token: &str,
@@ -92,12 +93,16 @@ pub async fn send_password_reset_email(
.path_segments_mut()
.unwrap()
.extend(["reset-password", "step2", token]);
let greeting = format!("Hello {},", display_name.unwrap_or(username));
let body = format!(
"Hello {username},
"{greeting}
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."