nuxt-modules / supabase

Supabase module for Nuxt.
https://supabase.nuxtjs.org
MIT License
703 stars 128 forks source link

Migrate to `@supabase/ssr` to improve SSR support #417

Closed th1m0 closed 1 month ago

th1m0 commented 1 month ago

Is your feature request related to a problem? Please describe.

It may be beneficial to migrate to @supabase/ssr for improved server-side rendering (SSR) support. This would also resolve SSR warnings like the following:

WARN  Using the user object as returned from supabase.auth.getSession() or from certain supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead, which authenticates the data by contacting the Supabase Auth server.

Describe the solution you'd like

Migrating to @supabase/ssr could help resolve the SSR-related issues.

Describe alternatives you've considered

N/A

Additional context

I'd be happy to implement this, if this is the direction we want to go into.

See: https://github.com/supabase/ssr https://github.com/orgs/supabase/discussions/27037 https://supabase.com/docs/guides/auth/server-side

larbish commented 1 month ago

We're already using @supabase/ssr under the hood and the warning comes from this lib. I've created an issue to encourage the maintainers to fix it: https://github.com/supabase/auth-js/issues/912. What issues are you facing with SSR?

th1m0 commented 1 month ago

Ah, that was stupid of me. I will see if I can fix the issue, then make another issue/PR accordingly! Thank you for the quick response.