From caaa62b35672bb042453aa02427e445142e68ca2 Mon Sep 17 00:00:00 2001 From: Jordan Blasenhauer Date: Wed, 22 May 2024 14:06:39 +0200 Subject: [PATCH] fix totp infinite loop on back to /login --- src/ui/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/main.py b/src/ui/main.py index f87766b00..011032e10 100755 --- a/src/ui/main.py +++ b/src/ui/main.py @@ -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 (