diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index 0c75d9a6..09c0bfba 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -212,6 +212,16 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ } }; + const refreshAuthState = useCallback(async () => { + try { + const { data } = await supabase.auth.getSession(); + setSession(data.session); + setUser(data.session?.user ?? null); + } catch (error) { + console.warn("Failed to refresh auth state:", error); + } + }, []); + const signIn = async (email: string, password: string) => { setLoading(true); try {