Display form to enter OTP code
This commit is contained in:
@ -29,7 +29,7 @@ impl TwoFactor {
|
||||
|
||||
pub fn login_url(&self, redirect_uri: &str) -> String {
|
||||
match self.kind {
|
||||
TwoFactorType::TOTP(_) => format!("/2fa_totp?id={}&redirect_uri={}",
|
||||
TwoFactorType::TOTP(_) => format!("/2fa_otp?id={}&redirect_uri={}",
|
||||
self.id.0, redirect_uri)
|
||||
}
|
||||
}
|
||||
@ -83,6 +83,10 @@ impl User {
|
||||
pub fn remove_factor(&mut self, factor_id: FactorID) {
|
||||
self.two_factor.retain(|f| f.id != factor_id);
|
||||
}
|
||||
|
||||
pub fn find_factor(&self, factor_id: &FactorID) -> Option<&TwoFactor> {
|
||||
self.two_factor.iter().find(|f| f.id.eq(&factor_id))
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for User {
|
||||
|
Reference in New Issue
Block a user