1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-08 03:53:57 +00:00

Add option to require new device emails

This commit is contained in:
vpl 2019-08-19 22:14:00 +02:00
parent 07743e490b
commit ee7837d022
2 changed files with 8 additions and 0 deletions

View file

@ -108,6 +108,10 @@ fn _password_login(data: ConnectData, conn: DbConn, ip: ClientIp) -> JsonResult
if CONFIG.mail_enabled() && new_device {
if let Err(e) = mail::send_new_device_logged_in(&user.email, &ip.ip.to_string(), &device.updated_at, &device.name) {
error!("Error sending new device email: {:#?}", e);
if CONFIG.require_device_email() {
err!("Could not send login notification email. Please contact your administrator.")
}
}
}