I'm using JWT and saves a token in sessionStorage at client side.
I have an auth middleware which will check if the token exists in the sessionStorage and redirect if not.
The problem is, when the browser loads the app, or refresh, the middleware does not run locally at the first time, which leads to the "not found" error of sessionStorage.
even beforeCreate and created lifecycle hooks are running in the "server side" so the first check point on the client side will be after those lifecycles and this leads to inefficient redirections. It will be cool if it can redirect the page with loading as less information as possible in the page.
Is there a way that can elegantly handle this issue?
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c705">#c705</a>)</em></sub></div>