diff options
author | vpl <[email protected]> | 2019-08-03 18:47:52 +0200 |
---|---|---|
committer | vpl <[email protected]> | 2019-08-04 16:56:41 +0200 |
commit | 29aedd388e0ff6558c4ee57db8c8e74b4d899be8 (patch) | |
tree | df9e322cc0fa7878d66fad784f12e5bd4545e423 /src/db/models/two_factor.rs | |
parent | 27e0e41835a09d3e6e5a2d00ad606fc998dda72d (diff) | |
download | vaultwarden-29aedd388e0ff6558c4ee57db8c8e74b4d899be8.tar.gz vaultwarden-29aedd388e0ff6558c4ee57db8c8e74b4d899be8.zip |
Add email code logic and move two_factor into separate modules
Diffstat (limited to 'src/db/models/two_factor.rs')
-rw-r--r-- | src/db/models/two_factor.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/db/models/two_factor.rs b/src/db/models/two_factor.rs index 30a7b475..a390e219 100644 --- a/src/db/models/two_factor.rs +++ b/src/db/models/two_factor.rs @@ -1,5 +1,12 @@ +use diesel; +use diesel::prelude::*; use serde_json::Value; +use crate::api::EmptyResult; +use crate::db::DbConn; +use crate::db::schema::twofactor; +use crate::error::MapResult; + use super::User; #[derive(Debug, Identifiable, Queryable, Insertable, Associations)] @@ -28,6 +35,8 @@ pub enum TwoFactorType { // These are implementation details U2fRegisterChallenge = 1000, U2fLoginChallenge = 1001, + EmailVerificationChallenge = 1002, + } /// Local methods @@ -59,14 +68,6 @@ impl TwoFactor { } } -use crate::db::schema::twofactor; -use crate::db::DbConn; -use diesel; -use diesel::prelude::*; - -use crate::api::EmptyResult; -use crate::error::MapResult; - /// Database methods impl TwoFactor { pub fn save(&self, conn: &DbConn) -> EmptyResult { |