From 311a58b9a998385961a369dfbdc895c915ba28df Mon Sep 17 00:00:00 2001 From: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> Date: Sun, 7 Mar 2021 00:41:53 +0300 Subject: Corrects Domain On Token Cookie Signed-off-by: Hassan Abouelela <47495861+HassanAbouelela@users.noreply.github.com> --- backend/routes/auth/authorize.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'backend/routes/auth/authorize.py') diff --git a/backend/routes/auth/authorize.py b/backend/routes/auth/authorize.py index 5742b9b..ce7b8bd 100644 --- a/backend/routes/auth/authorize.py +++ b/backend/routes/auth/authorize.py @@ -77,8 +77,9 @@ async def set_response_token( expiry: int ) -> None: """Helper that handles logic for updating a token in a set-cookie response.""" + stripped_domain = request_url.scheme + request_url.netloc if origin_url == constants.PRODUCTION_URL: - domain = request_url + domain = stripped_domain samesite = "strict" elif not constants.PRODUCTION: @@ -86,7 +87,7 @@ async def set_response_token( samesite = "strict" else: - domain = request_url + domain = stripped_domain samesite = "None" response.set_cookie( -- cgit v1.2.3