From 37200aeefcc96c7d090e2a9767119d381e3ca6a2 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Wed, 9 Aug 2023 22:52:53 -0400 Subject: [PATCH] Make cookie safe --- backend/endpoints/identity.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/endpoints/identity.py b/backend/endpoints/identity.py index fca2cdf58..5737f60d6 100644 --- a/backend/endpoints/identity.py +++ b/backend/endpoints/identity.py @@ -42,7 +42,9 @@ def login_with_password( data={"sub": user.username}, expires_delta=access_token_expires ) - response.set_cookie("access_token", access_token, httponly=True) + response.set_cookie( + "access_token", access_token, httponly=True, secure=True, samesite="strict" + ) return user