https://supabase.com/ logo
Invalid JWT (NUXT)
f

formigueiro

05/25/2023, 3:10 PM
Im using https://supabase.nuxtjs.org/get-started , so im getting that message some time when im using my project how could i refresh token or auto refresh token?:
g

garyaustin

05/25/2023, 3:29 PM
Does that Nuxt code not setup the client to do that? That is not Supabase code, it is on nuxtjs website. Maybe another Nuxt user has ideas on that. But you don't have NUXT in your title of your Post so may not look.
f

formigueiro

05/25/2023, 4:07 PM
In the documentation it says that the automatic update is true default
g

garyaustin

05/25/2023, 4:08 PM
Not sure then. If that was broken in supabase-js there would be tons of reports on it.
f

formigueiro

05/25/2023, 5:23 PM
ty
someone know about this topic?
js
const { data: authListener } = supabase.auth.onAuthStateChange(
  async (event, session) => {
    if (session) {

      if (!isLogged) {
        let { data: user_data, error } = await supabase
        .from('user_data')
        .select('email, id, avatar_url')
        .eq('id', session.user.id)
        .single();

        if (user_data) {
          setUser({ id: user_data.id, email: user_data.email });

          if (!currentUser.avatar_url) setAvatar(user_data.avatar_url);

          setLogged();
        }
      }

      if (useRoute().name === 'login') {
        setTimeout(() => {
          navigateTo('/dashboard/links');
        }, 200);
      }
    }
  }
);
@garyaustin could help me please? i saw the content and its passing the refersh token from cookies

https://cdn.discordapp.com/attachments/1111310299165905007/1111717182204817458/image.png

g

garyaustin

05/26/2023, 10:53 PM
Seems like it is not getting the refresh token in the session there should be an access token and a refresh token. I don't know Nuxt environment so not sure how you are passing it and why it might get lost. Is there a browser side and a server side to this?