Skip to content
This repository was archived by the owner on Jun 30, 2024. It is now read-only.

Commit fcdd1dd

Browse files
committed
make jwt work on subdomains
1 parent 9b70185 commit fcdd1dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/db.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,10 @@ def _create_access_token(data: dict, expires=None, scopes=None) -> bytes:
666666
response.cookies["access_token"] = encoded_jwt
667667
response.cookies["access_token"]["expires"] = 24 * 3600 * 30
668668
response.cookies["access_token"]["path"] = "/"
669+
if "LOAD_BALANCER_HOST" in os.environ:
670+
response.cookies["access_token"]["domain"] = os.environ[
671+
"LOAD_BALANCER_HOST"
672+
]
669673

670674
# decode here decodes the byte str to a normal str not the token
671675
return encoded_jwt

0 commit comments

Comments
 (0)