Refactor users management (#6)
All checks were successful
continuous-integration/drone/push Build is passing

* Improve second factor removal by admin
This commit is contained in:
2022-11-26 15:08:36 +01:00
parent 0d8af58e16
commit a2d731bfff
3 changed files with 32 additions and 8 deletions

View File

@@ -45,6 +45,15 @@ pub struct TwoFactor {
}
impl TwoFactor {
pub fn quick_description(&self) -> String {
format!(
"#{} of type {} and name '{}'",
self.id.0,
self.type_str(),
self.name
)
}
pub fn type_str(&self) -> &'static str {
match self.kind {
TwoFactorType::TOTP(_) => "Authenticator app",