mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-11-24 22:05:41 +03:00
Fix password hint showing logic
This commit is contained in:
parent
19e0605d30
commit
d68f57cbba
1 changed files with 5 additions and 4 deletions
|
@ -265,15 +265,16 @@ fn password_hint(data: JsonUpcase<PasswordHintData>, conn: DbConn) -> EmptyResul
|
||||||
}
|
}
|
||||||
|
|
||||||
let user = user.unwrap();
|
let user = user.unwrap();
|
||||||
let hint = user.password_hint.to_owned().unwrap_or("You don't have any...".to_string());
|
let hint = match user.password_hint {
|
||||||
|
Some(hint) => hint,
|
||||||
|
None => return Ok(()),
|
||||||
|
};
|
||||||
|
|
||||||
if let Some(ref mail_config) = CONFIG.mail {
|
if let Some(ref mail_config) = CONFIG.mail {
|
||||||
if let Err(e) = mail::send_password_hint(&user.email, &hint, mail_config) {
|
if let Err(e) = mail::send_password_hint(&user.email, &hint, mail_config) {
|
||||||
err!(format!("There have been a problem sending the email: {}", e));
|
err!(format!("There have been a problem sending the email: {}", e));
|
||||||
}
|
}
|
||||||
}
|
} else if CONFIG.show_password_hint {
|
||||||
|
|
||||||
if !CONFIG.show_password_hint {
|
|
||||||
err!(format!("Your password hint is: {}", &hint));
|
err!(format!("Your password hint is: {}", &hint));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue