fix 500 error

master
Aevann 2024-04-21 13:36:36 +02:00
parent be0a0ce491
commit eb80582a65
1 changed files with 6 additions and 6 deletions

View File

@ -582,13 +582,13 @@ def settings_security_post(v):
if not v.verifyPass(request.values.get('password')):
abort(400, "Invalid password!")
token = request.values.get("2fa_remove")
if v.mfa_secret:
token = request.values.get("2fa_remove")
if not token or not v.validate_2fa(token):
abort(400, "Invalid token!")
v.mfa_secret = None
g.db.add(v)
if not token or not v.validate_2fa(token):
abort(400, "Invalid token!")
v.mfa_secret = None
g.db.add(v)
return {"message": "Two-factor authentication disabled!"}
@app.post("/settings/log_out_all_others")