From d24f14503ecbef13d7b0e9828337544433c1ee39 Mon Sep 17 00:00:00 2001 From: maxsibilla Date: Tue, 29 Aug 2023 11:18:43 -0400 Subject: [PATCH] Adding new configuration for domain set by cookie --- src/instance/app.cfg.example | 3 +++ src/routes/auth/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/instance/app.cfg.example b/src/instance/app.cfg.example index 3c515c4f..009ac9fd 100644 --- a/src/instance/app.cfg.example +++ b/src/instance/app.cfg.example @@ -28,6 +28,9 @@ GLOBUS_ADMIN_FILE_USER_NAME = 'shirey' GLOBUS_GENOMIC_DATA_FILE_GROUP_NAME = 'hubseq' GLOBUS_CONSORTIUM_FILE_GROUP_NAME = 'hubmap' +#Sets the domain for the cookie set upon login to the portal. Use `localhost` for local development +COOKIE_DOMAIN = '.sennetconsortium.org' + #Entity-api ENTITY_WEBSERVICE_URL = 'http://entity-api:8080' diff --git a/src/routes/auth/__init__.py b/src/routes/auth/__init__.py index c36f57f2..b8247086 100644 --- a/src/routes/auth/__init__.py +++ b/src/routes/auth/__init__.py @@ -102,7 +102,7 @@ def _login(redirect_uri, key = 'tokens'): # create a response for the user response = make_response(redirect(redirect_uri)) - response.set_cookie('info', base64_json_str, expires=2**31 - 1, domain='.sennetconsortium.org') + response.set_cookie('info', base64_json_str, expires=2**31 - 1, domain=current_app.config['COOKIE_DOMAIN']) return response