From 0a857c4b98901b24086620ac94d403ae4672cff6 Mon Sep 17 00:00:00 2001 From: elsong86 Date: Sat, 9 Nov 2024 10:04:19 -0800 Subject: [PATCH] Fixed? --- backend/app/routers/auth.py | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/backend/app/routers/auth.py b/backend/app/routers/auth.py index 4b627b1..bf00344 100644 --- a/backend/app/routers/auth.py +++ b/backend/app/routers/auth.py @@ -29,15 +29,13 @@ async def signin(user_details: UserCreate, response: Response, db_service: Datab jwt_token = result["access_token"] response.set_cookie( - key="access_token", - value=jwt_token, - httponly=True, - secure=True, - samesite="None", - max_age=3600, - path="/", # Ensure this is set to root - domain="tacoaboutit.app" # Specify domain if applicable - ) + key="access_token", + value=jwt_token, + httponly=True, + secure=True, # Ensure HTTPS is used + samesite="None", # Or "Lax" for testing + max_age=3600 +) return {"message": "Signin successful"} @router.post("/logout") @@ -45,16 +43,3 @@ async def logout(response: Response): # Clear the cookie by setting an expired max_age response.delete_cookie(key="access_token", path="/", httponly=True) return {"message": "Logged out successfully"} - -@router.get("/set-test-cookie") -async def set_test_cookie(response: Response): - response.set_cookie( - key="test_cookie", - value="test_value", - httponly=True, - secure=True, - samesite="None", - max_age=3600, - path="/" - ) - return {"message": "Test cookie set"}