Ensure signIn return type remains void
cgen-fe34c29bb9474293a8227908773ed218
This commit is contained in:
parent
84ab954bc9
commit
16aba004b3
1 changed files with 1 additions and 5 deletions
|
|
@ -353,22 +353,18 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
|||
throw new Error("Please provide both email and password.");
|
||||
}
|
||||
|
||||
const { data, error } = await supabase.auth.signInWithPassword({
|
||||
const { error } = await supabase.auth.signInWithPassword({
|
||||
email,
|
||||
password,
|
||||
});
|
||||
|
||||
// Prefer explicit error from Supabase if present
|
||||
if (error) throw error;
|
||||
|
||||
// If signIn succeeded but no session info returned, attempt to refresh
|
||||
try {
|
||||
await supabase.auth.getSession();
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
return data;
|
||||
} catch (error: any) {
|
||||
console.error("SignIn error details:", error);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue