From 074b93f79ec594708503482e31405388a22c72a8 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Mon, 10 Nov 2025 21:58:58 +0000 Subject: [PATCH] Fix signIn to return user object for Login.tsx compatibility cgen-000542f19b3744a798ac3d30a63af094 --- client/contexts/AuthContext.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/contexts/AuthContext.tsx b/client/contexts/AuthContext.tsx index 03ab3d68..661ed094 100644 --- a/client/contexts/AuthContext.tsx +++ b/client/contexts/AuthContext.tsx @@ -490,7 +490,7 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ throw new Error("Please provide both email and password."); } - const { error } = await supabase.auth.signInWithPassword({ + const { data, error } = await supabase.auth.signInWithPassword({ email, password, }); @@ -502,6 +502,9 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ } catch (e) { // ignore } + + // Return user data for caller to use (e.g., Login.tsx) + return { user: data?.user ?? null }; } catch (error: any) { console.error("SignIn error details:", error);