Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
Attempt to fix tokens again
Browse files Browse the repository at this point in the history
  • Loading branch information
davenquinn committed Oct 19, 2024
1 parent 459943b commit 4197270
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions api/routes/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,26 @@ async def redirect_callback(code: str, state: Optional[str] = None):
# samesite="lax",
# )
# else:
response.set_cookie(
access_token_key,
f"Bearer {access_token}",
domain=domain,
httponly=True,
samesite="lax",
)

if "localhost" in redirect_domain:
# Adjust host header to localhost
response.headers["host"] = redirect_domain
response.set_cookie(
access_token_key,
f"Bearer {access_token}",
domain="localhost",
httponly=True,
samesite="lax",
)

else:
response.set_cookie(
access_token_key,
f"Bearer {access_token}",
domain=domain,
httponly=True,
samesite="lax",
)

return response

Expand Down

0 comments on commit 4197270

Please sign in to comment.