From b11a75f79c6b51ac9e12561fc501b65a6d7dd729 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Thu, 3 Oct 2024 09:55:16 +0200 Subject: [PATCH] Read OVERRIDE_ACCESS_COOKIE_PATH Env-Var to override access cookie path --- qwc_services_core/tenant_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qwc_services_core/tenant_handler.py b/qwc_services_core/tenant_handler.py index 8f42edc..41122d2 100644 --- a/qwc_services_core/tenant_handler.py +++ b/qwc_services_core/tenant_handler.py @@ -216,7 +216,10 @@ def tenant_path_prefix(self): def get_cookie_path(self, app): # https://flask.palletsprojects.com/en/1.1.x/api/#flask.sessions.SessionInterface.get_cookie_path - prefix = self.tenant_path_prefix() + if os.environ.get("OVERRIDE_ACCESS_COOKIE_PATH", None): + prefix = os.environ.get("OVERRIDE_ACCESS_COOKIE_PATH") + else: + prefix = self.tenant_path_prefix() # Set config as a side effect app.config['JWT_ACCESS_COOKIE_PATH'] = prefix return prefix