From 81b6c36f263132ba3f0cf17559605bb669ed814f Mon Sep 17 00:00:00 2001 From: "railway-app[bot]" <68434857+railway-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 20:28:22 +0000 Subject: [PATCH] fix: set accessToken cookie after Firebase redirect sign-in --- client/src/contexts/AuthContext.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/src/contexts/AuthContext.tsx b/client/src/contexts/AuthContext.tsx index daef2d30..11320e45 100644 --- a/client/src/contexts/AuthContext.tsx +++ b/client/src/contexts/AuthContext.tsx @@ -17,6 +17,7 @@ import { import { NavigateFunction } from "react-router-dom"; import { auth } from "../utils/auth/firebase"; +import { cookieKeys, setCookie } from "../utils/auth/cookie"; import { useBackendContext } from "./hooks/useBackendContext"; interface AuthContextProps { @@ -96,6 +97,10 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => { if (!result?.user) return; + + const idToken = await result.user.getIdToken(); + setCookie({ key: cookieKeys.ACCESS_TOKEN, value: idToken }); + let response = await backend.get(`/users/firebase/${result.user.uid}`); if (response.data.length === 0) {