react-supabase icon indicating copy to clipboard operation
react-supabase copied to clipboard

`useSignIn()` with Google OAuth creates account but hook does not work

Open ctjlewis opened this issue 2 years ago • 0 comments

Bug report

The useSignIn() hook does not work correctly.

Description / Observed Behavior

Try to use the sign-in hook, and successfully log in (the user is created in the Supabase console), but when I'm redirected, the new session is not loaded by the hook, despite that being the core functionality:

const [{ error, fetching, session, user }, signIn] = useSignIn();
console.log({ user, session });
// { user: undefined, session: undefined }

Expected Behavior

After signing in, the hook should return the user and session data.

const [{ error, fetching, session, user }, signIn] = useSignIn();
console.log({ user, session });
// something other than all undefined

Repro Steps / Code Example

Included.

Additional Context

Latest version. Basic sign-in. No idea why this would not work out of the box.

ctjlewis avatar Dec 30 '21 04:12 ctjlewis