Add a page to choose second factor

This commit is contained in:
2022-04-19 18:27:21 +02:00
parent 3add7a5d37
commit c1677071fc
5 changed files with 89 additions and 2 deletions

View File

@@ -26,6 +26,13 @@ impl TwoFactor {
TwoFactorType::TOTP(_) => "Authenticator app"
}
}
pub fn login_url(&self, redirect_uri: &str) -> String {
match self.kind {
TwoFactorType::TOTP(_) => format!("/2fa_totp?id={}&redirect_uri={}",
self.id.0, redirect_uri)
}
}
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]