Add a way to reset password
This commit is contained in:
parent
5d343c273f
commit
ed979719b5
12 changed files with 352 additions and 57 deletions
|
|
@ -32,10 +32,9 @@ impl From<lettre::error::Error> for Error {
|
|||
}
|
||||
}
|
||||
|
||||
pub async fn send_validation(
|
||||
site_url: &str,
|
||||
pub async fn send_email(
|
||||
email: &str,
|
||||
token: &str,
|
||||
message: &str,
|
||||
smtp_relay_address: &str,
|
||||
smtp_login: &str,
|
||||
smtp_password: &str,
|
||||
|
|
@ -45,10 +44,7 @@ pub async fn send_validation(
|
|||
.from("recipes@gburri.org".parse()?)
|
||||
.to(email.parse()?)
|
||||
.subject("recipes.gburri.org account validation")
|
||||
.body(format!(
|
||||
"Follow this link to confirm your inscription: {}/validation?validation_token={}",
|
||||
site_url, token
|
||||
))?;
|
||||
.body(message.to_string())?;
|
||||
|
||||
let credentials = Credentials::new(smtp_login.to_string(), smtp_password.to_string());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue