aboutsummaryrefslogtreecommitdiff
path: root/src/api/identity.rs
diff options
context:
space:
mode:
authorvpl <[email protected]>2019-08-19 22:14:00 +0200
committervpl <[email protected]>2019-08-19 22:14:00 +0200
commitee7837d022488986ebd17cc1aa39cd11da9f738b (patch)
treed62668c4440fa1a796466dffcb65d853526d9dce /src/api/identity.rs
parent07743e490b74f83d0d4af6d5f1e57f404fd3fcaf (diff)
downloadvaultwarden-ee7837d022488986ebd17cc1aa39cd11da9f738b.tar.gz
vaultwarden-ee7837d022488986ebd17cc1aa39cd11da9f738b.zip
Add option to require new device emails
Diffstat (limited to 'src/api/identity.rs')
-rw-r--r--src/api/identity.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/api/identity.rs b/src/api/identity.rs
index fe40dcd2..1990e35b 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -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.")
+ }
}
}