Skip to content

Commit

Permalink
Enum for 2FA methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanMcCormickJr committed Dec 12, 2024
1 parent ad42894 commit 0bc702a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/users.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// src/users.rs

#![forbid(unsafe_code)]
#[allow(dead_code)] // Remove this line after implementing the User struct


use regex::Regex;

Expand Down Expand Up @@ -66,12 +68,26 @@ impl Password {
}
}

pub enum SecondFactor {
U2F {
// Define U2F structure here
},
TOTP {
// Define TOTP structure here
},
EmailCode {
// Define email verification code structure here
},
RecoveryCodes {
// Define recovery codes structure here
},
}

pub struct User {
pub id: u32,
pub username: Username,
pub email: Email,
pub password: Password,
pub second_factor: Vec<u8>,
pub second_factor: SecondFactor,
}


0 comments on commit 0bc702a

Please sign in to comment.