supabase / ssr

Supabase clients for use in server-side rendering frameworks.
MIT License
54 stars 6 forks source link

Missing hooks for `useSupabaseClient`, `useUser`, `useSession` #30

Closed bombillazo closed 2 months ago

bombillazo commented 2 months ago

Bug report

Describe the bug

Moved from #744

The documentation recommends that we migrate away from the auth-helpers lib in favor of the ssr library:

image

The issue is that the @supabase/ssr library is missing essential React hooks for fetching the client and user auth data that we get from @supabase/auth-helpers-react. The docs should be updated if these hooks are not intended to be part of the SSR package. Importing both packages may create redundancy and multiple instance issues as specified here.

To Reproduce

N/A

Expected behavior

To replace auth-helpers with ssr, the hooks that were available before would also be available in the ssr package.

System information

Additional context

Add any other context about the problem here.

hf commented 2 months ago

This is not planned.

bombillazo commented 2 months ago

If that is the case, I recommend clearing up the documentation, it is very misleading https://supabase.com/docs/guides/auth/auth-helpers

mariomeissner commented 2 months ago

Why is it not planned? A hook to efficiently obtain the authentication state is an essential utility that any other auth library provides. If the React helpers will not be migrated, what is the recommended way to efficiently fetch authentication state within React client components?

C4T4 commented 1 month ago

Supabase Auth is an absolut mess right now. "We strongly recommend using the new @supabase/ssr package" - please don't.

bombillazo commented 1 month ago

@hf so... we do need @supabase/auth-helpers-react?