Skip to content

Commit

Permalink
Updated localhost cookie setting
Browse files Browse the repository at this point in the history
  • Loading branch information
davenquinn committed Oct 18, 2024
1 parent 2673448 commit 4e07223
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/routes/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "0.1.0"
description = ""
authors = ["Cannon Lock <[email protected]>"]
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.11"
Expand Down

0 comments on commit 4e07223

Please sign in to comment.