use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(untagged)]
pub enum MFAData {
Password { password: String },
Recovery { recovery_code: String },
Totp { totp_code: String },
}
#[derive(Deserialize, Debug, Clone, Eq, PartialEq)]
pub enum MFAMethod {
Password,
Recovery,
Totp,
}
pub type MFARecoveryCode = String;
#[derive(Deserialize, Debug, Clone)]
pub struct MFAStatus {
pub email_otp: bool,
pub trusted_handover: bool,
pub email_mfa: bool,
pub totp_mfa: bool,
pub security_key_mfa: bool,
pub recovery_active: bool,
}
#[derive(Deserialize, Debug, Clone)]
pub struct TOTPSecret {
pub secret: String,
}
#[derive(Deserialize, Debug, Clone)]
pub struct MFATicket {
#[serde(rename = "_id")]
pub id: String,
pub account_id: String,
pub token: String,
pub validated: bool,
pub authorised: bool,
pub last_totp_code: Option<String>,
}