aboutsummaryrefslogtreecommitdiff
path: root/src/api/identity.rs
diff options
context:
space:
mode:
authorDaniel <[email protected]>2024-09-18 20:03:15 +0300
committerGitHub <[email protected]>2024-09-18 19:03:15 +0200
commit21efc0800ddfc4378a541c6d507a1cd481496575 (patch)
treea46767b5630f6ec794d864f0717789b64de7db16 /src/api/identity.rs
parent1031c2e2863414ff7a1bedb33f458ebed19859bf (diff)
downloadvaultwarden-21efc0800ddfc4378a541c6d507a1cd481496575.tar.gz
vaultwarden-21efc0800ddfc4378a541c6d507a1cd481496575.zip
Actually use Device Type for mails (#4916)
- match Bitwarden behaviour - add a different segment in mails for Device Name
Diffstat (limited to 'src/api/identity.rs')
-rw-r--r--src/api/identity.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/identity.rs b/src/api/identity.rs
index 27f3eac6..4244d68d 100644
--- a/src/api/identity.rs
+++ b/src/api/identity.rs
@@ -265,7 +265,7 @@ async fn _password_login(
let twofactor_token = twofactor_auth(&user, &data, &mut device, ip, conn).await?;
if CONFIG.mail_enabled() && new_device {
- if let Err(e) = mail::send_new_device_logged_in(&user.email, &ip.ip.to_string(), &now, &device.name).await {
+ if let Err(e) = mail::send_new_device_logged_in(&user.email, &ip.ip.to_string(), &now, &device).await {
error!("Error sending new device email: {:#?}", e);
if CONFIG.require_device_email() {
@@ -421,7 +421,7 @@ async fn _user_api_key_login(
if CONFIG.mail_enabled() && new_device {
let now = Utc::now().naive_utc();
- if let Err(e) = mail::send_new_device_logged_in(&user.email, &ip.ip.to_string(), &now, &device.name).await {
+ if let Err(e) = mail::send_new_device_logged_in(&user.email, &ip.ip.to_string(), &now, &device).await {
error!("Error sending new device email: {:#?}", e);
if CONFIG.require_device_email() {
@@ -535,7 +535,7 @@ async fn twofactor_auth(
return Ok(None);
}
- TwoFactorIncomplete::mark_incomplete(&user.uuid, &device.uuid, &device.name, ip, conn).await?;
+ TwoFactorIncomplete::mark_incomplete(&user.uuid, &device.uuid, &device.name, device.atype, ip, conn).await?;
let twofactor_ids: Vec<_> = twofactors.iter().map(|tf| tf.atype).collect();
let selected_id = data.two_factor_provider.unwrap_or(twofactor_ids[0]); // If we aren't given a two factor provider, assume the first one