You've already forked lldap
mirror of
https://github.com/lldap/lldap.git
synced 2026-04-05 12:32:57 +01:00
Compare commits
6 Commits
main
...
copilot/fix-1268
| Author | SHA1 | Date | |
|---|---|---|---|
| c0e23f2251 | |||
| f1d0c400aa | |||
| c400fac481 | |||
| ccb389f2c2 | |||
| 19799351db | |||
| ad41c04092 |
@@ -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
@@ -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."
|
||||
|
||||
Reference in New Issue
Block a user