1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-23 18:57:23 +01:00

Merge remote-tracking branch 'fspoettel/admin-panel-2fa' into totp

This commit is contained in:
downtownallday
2020-09-28 23:25:29 -04:00
3 changed files with 49 additions and 45 deletions

View File

@@ -426,12 +426,12 @@ def totp_post_enable():
token = request.form.get('token')
label = request.form.get('label')
if type(token) != str:
return json_response({ "error": 'bad_input' }, 400)
return ("Bad Input", 400)
try:
mfa_totp.validate_secret(secret)
enable_mfa(request.user_email, "totp", secret, token, label, env)
except ValueError as e:
return str(e)
return (str(e), 400)
return "OK"
@app.route('/mfa/disable', methods=['POST'])