Fix signIn to return user object for Login.tsx compatibility

cgen-000542f19b3744a798ac3d30a63af094
This commit is contained in:
Builder.io 2025-11-10 21:58:58 +00:00
parent 447d300eaf
commit 074b93f79e

View file

@ -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);