From fa259e0988b40ca80b7933179e59356ce85c32db Mon Sep 17 00:00:00 2001 From: FuHsinyu Date: Wed, 4 Dec 2024 07:47:22 +0100 Subject: [PATCH 1/2] tie csrf token lifetime to session --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index 0666c81d..793f8b37 100644 --- a/app.py +++ b/app.py @@ -153,7 +153,7 @@ def load_admin_setting() -> Dict[str, Any]: # CSRF protection. csrf = CSRFProtect(app) - +app.config['WTF_CSRF_TIME_LIMIT'] = None # Set CSRF token lifetime tied to the life of the session. @app.before_request def static_loader() -> Optional[Response]: From eac60739144d7cd7a280e8d3ff5268e9cc145567 Mon Sep 17 00:00:00 2001 From: FuHsinyu Date: Wed, 4 Dec 2024 08:19:22 +0100 Subject: [PATCH 2/2] fix lint --- app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app.py b/app.py index 793f8b37..6b2b12e9 100644 --- a/app.py +++ b/app.py @@ -155,6 +155,7 @@ def load_admin_setting() -> Dict[str, Any]: csrf = CSRFProtect(app) app.config['WTF_CSRF_TIME_LIMIT'] = None # Set CSRF token lifetime tied to the life of the session. + @app.before_request def static_loader() -> Optional[Response]: """