Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple GoTrueClient instances when using supabase/ssr and @supabase/auth-helpers #739

Open
2 tasks done
bombillazo opened this issue Feb 6, 2024 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@bombillazo
Copy link

bombillazo commented Feb 6, 2024

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

As recommended by the Supabase docs, we started using the new SSR library to handle our Next.js auth clients int he front end. However, we still need access to the regular auth hooks provided by auth-helpers, such as the useSession hook. So we now have both libraries installed at the same time.

This causes unexpected issues where the auth tokens suddenly get erased and other weird behavior.

To Reproduce

  1. install both "@supabase/ssr" and ""@supabase/auth-helpers-react"
  2. create a next page with a hook like useSession and also create an ssr browser client
  3. load a page and check the console.

Expected behavior

No issues with the library

Screenshots

image

System information

  • Browser (if applies)chrome, firefox
  • Version of supabase-js: 2.39.3
@bombillazo bombillazo added the bug Something isn't working label Feb 6, 2024
@kvetoslavnovak
Copy link

What is the point to use both libraries? Official documentation says that you should use only one or another, not both.

@bombillazo
Copy link
Author

bombillazo commented Feb 9, 2024

@kvetoslavnovak The post clearly says why, supabase/ssr does not have the useSession, useUser hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants