Fix signIn to return user object for Login.tsx compatibility
cgen-000542f19b3744a798ac3d30a63af094
This commit is contained in:
parent
447d300eaf
commit
074b93f79e
1 changed files with 4 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue