use self::totp::Totp;
pub mod totp;
#[derive(Default, Debug, Serialize, Deserialize, Clone)]
pub struct MultiFactorAuthentication {
#[serde(skip_serializing_if = "Totp::is_empty", default)]
pub totp_token: Totp,
#[serde(skip_serializing_if = "Vec::is_empty", default)]
pub recovery_codes: Vec<String>,
}
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "schemas", derive(JsonSchema))]
pub enum MFAMethod {
Password,
Recovery,
Totp,
}
#[derive(Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "schemas", derive(JsonSchema))]
#[serde(untagged)]
pub enum MFAResponse {
Password { password: String },
Recovery { recovery_code: String },
Totp { totp_code: String },
}