fix totp infinite loop on back to /login

This commit is contained in:
Jordan Blasenhauer 2024-05-22 14:06:39 +02:00
parent e99937fb19
commit caaa62b356

View file

@ -470,7 +470,9 @@ def before_request():
and not request.path.startswith(("/css", "/images", "/js", "/json", "/webfonts"))
and request.path.endswith("/login")
):
return redirect(url_for("login", next=request.path))
logout_user()
session.clear()
return redirect(url_for("login"))
# Case not login page, keep on 2FA before any other access
if (