mirror of
https://github.com/simple-login/app.git
synced 2024-11-10 17:35:27 +08:00
can disable both OTP and FIDO
This commit is contained in:
parent
dc243d6027
commit
63e1baf46a
1 changed files with 8 additions and 4 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue