I’m new in NodeJS and want to develop with AdonisJS because I come from Laravel.
I’m developping a webapp with AdonisJS as an API and NuxtJS as a frontend. So I use the JWT authentification but I need help on some things !
I have a form that send a post request with axios and I have the line below to get the bearer token stored in the cookie :
const token = localStorage.getItem('auth._token.local')
It works, but when I refresh the page I have a ReferenceError : localStorage is not defined. I think that my way to initiate the token variable and pass it to the API is not good…
Maybe you can give me the solution or an example ?
Waiting for your answers…
(Sorry for my English, I’m French !)