mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-06 01:38:09 +00:00
Add email code logic and move two_factor into separate modules
This commit is contained in:
parent
27e0e41835
commit
29aedd388e
11 changed files with 1462 additions and 2275 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue