Can force 2FA authent
This commit is contained in:
@@ -90,11 +90,17 @@ impl TwoFactor {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn login_url(&self, redirect_uri: &LoginRedirect) -> String {
|
||||
pub fn login_url(&self, redirect_uri: &LoginRedirect, force_2fa: bool) -> String {
|
||||
match self.kind {
|
||||
TwoFactorType::TOTP(_) => format!("/2fa_otp?redirect={}", redirect_uri.get_encoded()),
|
||||
TwoFactorType::TOTP(_) => format!(
|
||||
"/2fa_otp?redirect={}&force_2fa={force_2fa}",
|
||||
redirect_uri.get_encoded()
|
||||
),
|
||||
TwoFactorType::WEBAUTHN(_) => {
|
||||
format!("/2fa_webauthn?redirect={}", redirect_uri.get_encoded())
|
||||
format!(
|
||||
"/2fa_webauthn?redirect={}&force_2fa={force_2fa}",
|
||||
redirect_uri.get_encoded()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user