Invalid JWT (NUXT)
# help-and-questions
f
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
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
In the documentation it says that the automatic update is true default
g
Not sure then. If that was broken in supabase-js there would be tons of reports on it.
f
ty
someone know about this topic?
Copy code
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
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?
2 Views