From 4e07223bce465be8f0da42cf5aba81ddd76b9afc Mon Sep 17 00:00:00 2001 From: Daven Quinn Date: Fri, 18 Oct 2024 10:07:41 -0500 Subject: [PATCH] Updated localhost cookie setting --- api/routes/security.py | 8 ++++---- pyproject.toml | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/routes/security.py b/api/routes/security.py index 88513dd..eb45453 100644 --- a/api/routes/security.py +++ b/api/routes/security.py @@ -310,10 +310,10 @@ async def redirect_callback(code: str, state: Optional[str] = None): # Set a cookie for the API domain response.set_cookie(**details, domain=domain) - if "localhost" in redirect_domain: - # Set a cookie for the localhost redirect. - # We may want to limit this to the development environment in the future. - response.set_cookie(**details, domain=redirect_domain) + # Set the same cookie for localhost if we're doing a redirect to another domain (this is likely a dev mode request) + # We may want to restrict this to development environments in the future... + if redirect_domain not in [domain, ""]: + response.set_cookie(**details, domain="localhost") return response diff --git a/pyproject.toml b/pyproject.toml index 63565a3..e2df22a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ version = "0.1.0" description = "" authors = ["Cannon Lock "] readme = "README.md" +package-mode = false [tool.poetry.dependencies] python = "^3.11"