mirror of
https://github.com/lldap/lldap.git
synced 2026-06-23 20:36:24 +00:00
Compare commits
6 Commits
main
...
copilot/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0e23f2251 | ||
|
|
f1d0c400aa | ||
|
|
c400fac481 | ||
|
|
ccb389f2c2 | ||
|
|
19799351db | ||
|
|
ad41c04092 |
@@ -186,9 +186,8 @@ where
|
|||||||
Some(token) => token,
|
Some(token) => token,
|
||||||
};
|
};
|
||||||
if let Err(e) = super::mail::send_password_reset_email(
|
if let Err(e) = super::mail::send_password_reset_email(
|
||||||
user.display_name
|
user.display_name.as_deref(),
|
||||||
.as_deref()
|
user.user_id.as_str(),
|
||||||
.unwrap_or_else(|| user.user_id.as_str()),
|
|
||||||
user.email.as_str(),
|
user.email.as_str(),
|
||||||
&token,
|
&token,
|
||||||
&data.server_url,
|
&data.server_url,
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ async fn send_email(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn send_password_reset_email(
|
pub async fn send_password_reset_email(
|
||||||
|
display_name: Option<&str>,
|
||||||
username: &str,
|
username: &str,
|
||||||
to: &str,
|
to: &str,
|
||||||
token: &str,
|
token: &str,
|
||||||
@@ -92,12 +93,16 @@ pub async fn send_password_reset_email(
|
|||||||
.path_segments_mut()
|
.path_segments_mut()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.extend(["reset-password", "step2", token]);
|
.extend(["reset-password", "step2", token]);
|
||||||
|
let greeting = format!("Hello {},", display_name.unwrap_or(username));
|
||||||
|
|
||||||
let body = format!(
|
let body = format!(
|
||||||
"Hello {username},
|
"{greeting}
|
||||||
This email has been sent to you in order to validate your identity.
|
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
|
If you did not initiate the process your credentials might have been
|
||||||
compromised. You should reset your password and contact an administrator.
|
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}
|
To reset your password please visit the following URL: {reset_url}
|
||||||
|
|
||||||
Please contact an administrator if you did not initiate the process."
|
Please contact an administrator if you did not initiate the process."
|
||||||
|
|||||||
Reference in New Issue
Block a user