XThomasBU
commited on
Commit
·
acdd981
1
Parent(s):
06e6599
format changes
Browse files- code/app.py +1 -3
code/app.py
CHANGED
@@ -97,10 +97,8 @@ async def del_user_info_from_cookie(request: Request, response: Response):
|
|
97 |
# Delete cookies from the response
|
98 |
response.delete_cookie("X-User-Info")
|
99 |
response.delete_cookie("session_token")
|
100 |
-
|
101 |
# Get the session token from the request cookies
|
102 |
session_token = request.cookies.get("session_token")
|
103 |
-
|
104 |
# Check if the session token exists in the session_store before deleting
|
105 |
if session_token and session_token in session_store:
|
106 |
del session_store[session_token]
|
@@ -196,7 +194,7 @@ async def auth_google(request: Request):
|
|
196 |
response = RedirectResponse(url="/post-signin", status_code=303)
|
197 |
response.set_cookie(key="session_token", value=session_token)
|
198 |
response.set_cookie(
|
199 |
-
key="X-User-Info", value=user_info_encoded, httponly=True)
|
200 |
return response
|
201 |
except Exception as e:
|
202 |
print(f"Error during Google OAuth callback: {e}")
|
|
|
97 |
# Delete cookies from the response
|
98 |
response.delete_cookie("X-User-Info")
|
99 |
response.delete_cookie("session_token")
|
|
|
100 |
# Get the session token from the request cookies
|
101 |
session_token = request.cookies.get("session_token")
|
|
|
102 |
# Check if the session token exists in the session_store before deleting
|
103 |
if session_token and session_token in session_store:
|
104 |
del session_store[session_token]
|
|
|
194 |
response = RedirectResponse(url="/post-signin", status_code=303)
|
195 |
response.set_cookie(key="session_token", value=session_token)
|
196 |
response.set_cookie(
|
197 |
+
key="X-User-Info", value=user_info_encoded, httponly=True) # TODO: is the flag httponly=True necessary?
|
198 |
return response
|
199 |
except Exception as e:
|
200 |
print(f"Error during Google OAuth callback: {e}")
|