aboutsummaryrefslogtreecommitdiff
path: root/src/db/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/models')
-rw-r--r--src/db/models/cipher.rs5
-rw-r--r--src/db/models/mod.rs2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/db/models/cipher.rs b/src/db/models/cipher.rs
index 75d54df2..048cb4d1 100644
--- a/src/db/models/cipher.rs
+++ b/src/db/models/cipher.rs
@@ -46,10 +46,9 @@ db_object! {
}
}
-#[allow(dead_code)]
pub enum RepromptType {
None = 0,
- Password = 1, // not currently used in server
+ Password = 1,
}
/// Local methods
@@ -296,7 +295,7 @@ impl Cipher {
"creationDate": format_date(&self.created_at),
"revisionDate": format_date(&self.updated_at),
"deletedDate": self.deleted_at.map_or(Value::Null, |d| Value::String(format_date(&d))),
- "reprompt": self.reprompt.unwrap_or(RepromptType::None as i32),
+ "reprompt": self.reprompt.filter(|r| *r == RepromptType::None as i32 || *r == RepromptType::Password as i32).unwrap_or(RepromptType::None as i32),
"organizationId": self.organization_uuid,
"key": self.key,
"attachments": attachments_json,
diff --git a/src/db/models/mod.rs b/src/db/models/mod.rs
index c336cb1a..43595bee 100644
--- a/src/db/models/mod.rs
+++ b/src/db/models/mod.rs
@@ -18,7 +18,7 @@ mod user;
pub use self::attachment::Attachment;
pub use self::auth_request::AuthRequest;
-pub use self::cipher::Cipher;
+pub use self::cipher::{Cipher, RepromptType};
pub use self::collection::{Collection, CollectionCipher, CollectionUser};
pub use self::device::{Device, DeviceType};
pub use self::emergency_access::{EmergencyAccess, EmergencyAccessStatus, EmergencyAccessType};