Never save the token in the local storage, if you do, you are exposing your app to potential attacks. If you are using Nuxt.js, you should simply make plugin and put this
exportdefaultfunction({store}){window.onNuxtReady(()=>{// refresh the token});}
As stated in the Nuxt.js docs for the plugin:
Nuxt.js allows you to define JavaScript plugins to be run before instantiating the root Vue.js Application.
If you are using some other JS library, check their doocumentation and see how can you run some function before instantiating the root app.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Never save the token in the local storage, if you do, you are exposing your app to potential attacks. If you are using Nuxt.js, you should simply make plugin and put this
As stated in the Nuxt.js docs for the plugin:
If you are using some other JS library, check their doocumentation and see how can you run some function before instantiating the root app.