Handle unsign can generate other exceptions
This commit is contained in:
parent
aadda7cb0d
commit
b05daecd28
|
@ -38,7 +38,7 @@ def auth_mfa():
|
|||
s = Signer(FLASK_SECRET)
|
||||
try:
|
||||
user_id = int(s.unsign(mfa_key))
|
||||
except BadSignature:
|
||||
except Exception:
|
||||
return jsonify(error="Invalid mfa_key"), 400
|
||||
|
||||
user = User.get(user_id)
|
||||
|
|
|
@ -142,8 +142,9 @@ def mailbox_verify():
|
|||
|
||||
try:
|
||||
r_id = int(s.unsign(mailbox_id))
|
||||
except BadSignature:
|
||||
except Exception:
|
||||
flash("Invalid link. Please delete and re-add your mailbox", "error")
|
||||
return redirect(url_for("dashboard.mailbox_route"))
|
||||
else:
|
||||
mailbox = Mailbox.get(r_id)
|
||||
mailbox.verified = True
|
||||
|
|
|
@ -156,7 +156,7 @@ def mailbox_confirm_change_route():
|
|||
|
||||
try:
|
||||
r_id = int(s.unsign(mailbox_id))
|
||||
except BadSignature:
|
||||
except Exception:
|
||||
flash("Invalid link", "error")
|
||||
return redirect(url_for("dashboard.index"))
|
||||
else:
|
||||
|
@ -179,4 +179,3 @@ def mailbox_confirm_change_route():
|
|||
else:
|
||||
flash("Invalid link", "error")
|
||||
return redirect(url_for("dashboard.index"))
|
||||
|
||||
|
|
Loading…
Reference in a new issue