From 29aedd388e0ff6558c4ee57db8c8e74b4d899be8 Mon Sep 17 00:00:00 2001 From: vpl Date: Sat, 3 Aug 2019 18:47:52 +0200 Subject: Add email code logic and move two_factor into separate modules --- src/db/models/two_factor.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/db/models/two_factor.rs') 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 { -- cgit v1.2.3