aboutsummaryrefslogtreecommitdiff
path: root/src/db
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/db
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/db')
-rw-r--r--src/db/models/two_factor_incomplete.rs3
-rw-r--r--src/db/schemas/mysql/schema.rs1
-rw-r--r--src/db/schemas/postgresql/schema.rs1
-rw-r--r--src/db/schemas/sqlite/schema.rs1
4 files changed, 6 insertions, 0 deletions
diff --git a/src/db/models/two_factor_incomplete.rs b/src/db/models/two_factor_incomplete.rs
index 49f7691f..12813eb5 100644
--- a/src/db/models/two_factor_incomplete.rs
+++ b/src/db/models/two_factor_incomplete.rs
@@ -13,6 +13,7 @@ db_object! {
// must complete 2FA login before being added into the devices table.
pub device_uuid: String,
pub device_name: String,
+ pub device_type: i32,
pub login_time: NaiveDateTime,
pub ip_address: String,
}
@@ -23,6 +24,7 @@ impl TwoFactorIncomplete {
user_uuid: &str,
device_uuid: &str,
device_name: &str,
+ device_type: i32,
ip: &ClientIp,
conn: &mut DbConn,
) -> EmptyResult {
@@ -44,6 +46,7 @@ impl TwoFactorIncomplete {
twofactor_incomplete::user_uuid.eq(user_uuid),
twofactor_incomplete::device_uuid.eq(device_uuid),
twofactor_incomplete::device_name.eq(device_name),
+ twofactor_incomplete::device_type.eq(device_type),
twofactor_incomplete::login_time.eq(Utc::now().naive_utc()),
twofactor_incomplete::ip_address.eq(ip.ip.to_string()),
))
diff --git a/src/db/schemas/mysql/schema.rs b/src/db/schemas/mysql/schema.rs
index 58ec55a2..fa84ed05 100644
--- a/src/db/schemas/mysql/schema.rs
+++ b/src/db/schemas/mysql/schema.rs
@@ -169,6 +169,7 @@ table! {
user_uuid -> Text,
device_uuid -> Text,
device_name -> Text,
+ device_type -> Integer,
login_time -> Timestamp,
ip_address -> Text,
}
diff --git a/src/db/schemas/postgresql/schema.rs b/src/db/schemas/postgresql/schema.rs
index 10b5313e..d1ea4b02 100644
--- a/src/db/schemas/postgresql/schema.rs
+++ b/src/db/schemas/postgresql/schema.rs
@@ -169,6 +169,7 @@ table! {
user_uuid -> Text,
device_uuid -> Text,
device_name -> Text,
+ device_type -> Integer,
login_time -> Timestamp,
ip_address -> Text,
}
diff --git a/src/db/schemas/sqlite/schema.rs b/src/db/schemas/sqlite/schema.rs
index 10b5313e..d1ea4b02 100644
--- a/src/db/schemas/sqlite/schema.rs
+++ b/src/db/schemas/sqlite/schema.rs
@@ -169,6 +169,7 @@ table! {
user_uuid -> Text,
device_uuid -> Text,
device_name -> Text,
+ device_type -> Integer,
login_time -> Timestamp,
ip_address -> Text,
}