nuxt-modules / supabase

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

Middleware not working well #370

Closed QThans closed 6 months ago

QThans commented 6 months ago

I can get user by using const { supabaseUser } = useSupabaseUser(supabase). However, the middleware is not working well, it redirects to '/login' every time.

QThans commented 6 months ago

after refresh, login status invalid, the middleware determines whether the login error occurred and jumps to the login page.

caiotarifa commented 5 months ago

Hello, @QThans.

Did you find a solution? I'm going through the same problem.

QThans commented 5 months ago

caiotarifa

for me, caused by the wrong code for using useSupabaseClient.

victor-ponamariov commented 4 months ago

How did you solve it?

https://supabase.nuxtjs.org/usage/composables/usesupabaseuser

This middleware returns null for the user. If I remove the middleware, I can access user via useSupabaseUser in other places