Authentication in Nuxt 3 using an Express.JS API
I was wondering what would be the best way of integrating my already existing Express.JS based API into Nuxt 3 and use its features.
I already tried a guide that mentioned 'useCookie()', but from my testing, that doesnt persist across page reloads. Currently experimenting with Pinia, but that doesnt seem to work across reloads as well.
Its a simple user-password based auth API that returns a jwt after logging in and after that every request is validated by sending the token in an auth header and in return receives the ID of the user.
1 Reply
Usage with Nuxt3 | pinia-plugin-persistedstate
🍍 Configurable persistence and rehydration of Pinia stores.