From 9d4618f413e5589dd4a39d43b62fd1dca56d0f0e Mon Sep 17 00:00:00 2001 From: Mikko Heikkinen Date: Tue, 16 Jul 2024 15:45:15 +0300 Subject: [PATCH] Clear session if logout fully successfull --- app/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index c5e706c..c39bad0 100644 --- a/app/main.py +++ b/app/main.py @@ -267,8 +267,6 @@ def login_page(): @app.route("/logout") def logout(): - session.clear() - if "localhost" == g.itsystem_name: api_url = "https://fmnh-ws-test.it.helsinki.fi/laji-auth/token/" elif "development" == g.itsystem_name: @@ -281,6 +279,7 @@ def logout(): # Checking if the request was successful if response.status_code == 200: + session.clear() flash("Olet kirjautunut ulos.", "info") return redirect("/") else: