Closed dcruz1990 closed 3 years ago
https://auth.nuxtjs.org/ Check this...
In this doc they don't use any plugin to persist the state.
"nuxt.js/examples at dev · nuxt/nuxt.js" https://github.com/nuxt/nuxt.js/tree/dev/examples
https://auth.nuxtjs.org/ Check this...
In this doc they don't use any plugin to persist the state.
"nuxt.js/examples at dev · nuxt/nuxt.js" https://github.com/nuxt/nuxt.js/tree/dev/examples
That's not what the OP wants. He already knows how to persist state using nuxt js's middlewares. If you read carefully the "What happened section", what he really wants to achieve is to be able to persist the auth state after the page gets reloaded by pressing F5. And using SSR (by looking at his plugin, which is the same as this: https://github.com/robinvdvleuten/vuex-persistedstate#using-cookies-universal-client--server-side).
https://auth.nuxtjs.org/ Check this...
In this doc they don't use any plugin to persist the state.
"nuxt.js/examples at dev · nuxt/nuxt.js" https://github.com/nuxt/nuxt.js/tree/dev/examples
Please don't answer when you haven't carefully read the OP's issue. This is completely off-track.
This does not look like a bug with the plugin but with your application. Please ask for help on either StackOverflow or any Nuxt / Vue related forums.
vuex-persistedstate
version: 4.0.0-beta.3node
version: 12.20.0npm
(oryarn
) version: 7.5.4What you did: Set this config in plugins:
then configure NuxtJS to use that plugin.
Then, define a middleware in middleware project folder:
And finally in NuxtPage set:
What happened: When the user logs in, everything works fine, but when the page is reload via F5, im being returned to login. That isnt suppose to happen because the store remains on
isAuthenticated: true
Problem description: VuexPersistedStore doestn works on NuxtJS auth middleware (route guard) when page reloads via F5.