can disable both OTP and FIDO

This commit is contained in:
Son 2021-11-22 11:31:49 +01:00
parent dc243d6027
commit 63e1baf46a
1 changed files with 8 additions and 4 deletions

View File

@ -110,16 +110,20 @@ class UserAdmin(SLModelView):
Session.commit()
@action(
"disable_otp",
"Disable OTP",
"Disable OTP?",
"disable_otp_fido",
"Disable OTP & FIDO",
"Disable OTP & FIDO?",
)
def disable_otp(self, ids):
def disable_otp_fido(self, ids):
for user in User.filter(User.id.in_(ids)):
if user.enable_otp:
user.enable_otp = False
flash(f"Disable OTP for {user}", "info")
if user.fido_uuid:
user.fido_uuid = None
flash(f"Disable FIDO for {user}", "info")
Session.commit()
@action(