mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-10-24 16:33:39 +03:00
2fa email fallback need a verified email (#7770)
Co-authored-by: Timshel <timshel@users.noreply.github.com> Co-authored-by: Mathijs van Veluw <black.dex@gmail.com>
This commit is contained in:
3 files changed
+12
-7
No files matched your search
@@ -3038,11 +3038,12 @@ async fn recover_account(
|
||||
err!("Organization user must be confirmed for password reset functionality");
|
||||
}
|
||||
|
||||
let fallback_2fa_email = if req.reset_two_factor && CONFIG.email_2fa_auto_fallback() {
|
||||
TwoFactor::find_by_user_and_type(&user.uuid, TwoFactorType::Email as i32, &conn).await.is_none()
|
||||
} else {
|
||||
false
|
||||
};
|
||||
let fallback_2fa_email =
|
||||
if req.reset_two_factor && CONFIG.mail_enabled() && CONFIG.email_2fa_auto_fallback() && user.verified() {
|
||||
TwoFactor::find_by_user_and_type(&user.uuid, TwoFactorType::Email as i32, &conn).await.is_none()
|
||||
} else {
|
||||
false
|
||||
};
|
||||
|
||||
// Sending email first ensure working email configuration and the resulting user notification.
|
||||
// Also this might add some protection against security flaws and misuse
|
||||
|
||||
Reference in new issue
Block a user