Static GitHub Issues

[1004] Redirect in a middleware resets the store

prev: client vs server rendered HTML request
next: Loading file based css

I am currently using an authentication middleware to check if the user is logged in or not. If not, the user is redirected to a login page. My problem is that I want to save the current route (before the redirect) so that I can send the user back to the page they were trying to get before the redirect. Now, the redirect method seems to reset the store, I've tried this with multiple middleware. Is there any other way I can redirect the user to the login page that won't reset the store ? I can't seem to be able to access the router with this.$router or with this.$nuxt.$router.

<!--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/c873">#c873</a>)</em></sub></div>