Skip to content

Commit

Permalink
Maybe this is needed?
Browse files Browse the repository at this point in the history
  • Loading branch information
quincylvania committed Oct 4, 2024
1 parent f730530 commit d44100c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions images/dashboard/src/routes/login_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def initialize_session(request: Request, box: str = Query(...), end_redirect_uri
"created_at": new_session.created_at.isoformat(),
}
)
# Set session_id with session_id
response.set_cookie(key="session_id", value=session_id)
# Set cookie_id with session_id
response.set_cookie(key="cookie_id", value=session_id)
logging.info("Generated new session_id and saved to database")
return response

Expand Down Expand Up @@ -121,7 +121,7 @@ async def redirect_sandbox(request: Request, code: str, db: Session = Depends(ge
logging.info(f"Fetched user details for: {display_name}")

# Here is where it gets the session id
session_id = request.cookies.get("session_id")
session_id = request.cookies.get("cookie_id")
if session_id:
session_obj = update_user_session(db, session_id, display_name)

Expand All @@ -143,7 +143,7 @@ async def redirect_sandbox(request: Request, code: str, db: Session = Depends(ge

logging.info(f"Redirecting to URL: {end_redirect_uri}")
response = RedirectResponse(url=end_redirect_uri)
response.delete_cookie("session_id")
response.delete_cookie("cookie_id")
return response
else:
logging.error("Session ID not found in cookies")
Expand Down

0 comments on commit d44100c

Please sign in to comment.