about summary refs log tree commit diff
path: root/uploader
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-04-05 09:25:16 -0500
committerFrederick Muriuki Muriithi2025-04-05 09:27:00 -0500
commitd490dccf4717c2817a2070f7354af18a6b5be825 (patch)
tree2affb8775db115fc274d261f8c262fe6f78deffc /uploader
parentb7304bbd9d09f9692a9c4a3f1bd0be3e59cbb4b7 (diff)
downloadgn-uploader-d490dccf4717c2817a2070f7354af18a6b5be825.tar.gz
Don't clear anonymous sessions with every check for login.
Diffstat (limited to 'uploader')
-rw-r--r--uploader/authorisation.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/uploader/authorisation.py b/uploader/authorisation.py
index 313bc38..bc950d8 100644
--- a/uploader/authorisation.py
+++ b/uploader/authorisation.py
@@ -16,14 +16,12 @@ def require_login(function):
     @wraps(function)
     def __is_session_valid__(*args, **kwargs):
         """Check that the user is logged in and their token is valid."""
-        def __clear_session__(_no_token):
-            session.clear_session_info()
-            flash("You need to be signed in.", "alert-danger big-alert")
+        def __alert_needs_sign_in__(_no_token):
             flash("You need to be signed in.", "alert alert-danger big-alert")
             return redirect("/")
 
         return session.user_token().either(
-            __clear_session__,
+            __alert_needs_sign_in__,
             lambda token: function(*args, **kwargs))
     return __is_session_valid__