You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this.$auth.user, this.$auth.loggedIn to show real value equal to this.$store.state.auth.loggedIn, this.$store.state.auth.user
What is actually happening?
token is used, /api/user/ and all other endpoints with checks for token is returning data correctly.
this.$user.getToken() also seems to work.
however console.log('USER', this.$auth.user, this.$auth.loggedIn, this.$store.state.auth.user, this.$store.state.auth.loggedIn)
Looks like storage engine (lib/core/storage.js) works incorrect. Stores data to my vuex store, but can't read from state directly.
While token seems to be stored using setUniversal/getUniversal, and is correctly setted in nuxt-axios instance headers.
if I add console log in lib/core/auth.js setUser and get user () I see following after call login:
> setUser false
> setUser {_id: "5dd65ff098711f313c3be6e6", email: "...",…} // several times in between goes my route push
> get user() this.$state
loggedIn: false
strategy: "local"
user: null
> get user () this.$storage._useVuex.state.auth // storage.js this._useVuex = this.options.vuex && this.ctx.store leaves store there....
busy: false
loggedIn: true
strategy: "local"
user: Object
after refreshing page Cmd+R data reveals correctly.
This bug report is available on Nuxt community (#c448)
The text was updated successfully, but these errors were encountered:
Version
v4.8.4
Reproduction link
http://later-if-need
Steps to reproduce
note that in documentation: vuex.namespace option is set to 'auth' by default...
What is expected ?
this.$auth.user, this.$auth.loggedIn to show real value equal to this.$store.state.auth.loggedIn, this.$store.state.auth.user
What is actually happening?
token is used, /api/user/ and all other endpoints with checks for token is returning data correctly.
this.$user.getToken() also seems to work.
however
console.log('USER', this.$auth.user, this.$auth.loggedIn, this.$store.state.auth.user, this.$store.state.auth.loggedIn)
gives me:
USER null false {…} true
adding
shows correct request but nothing changed.
Additional comments?
Looks like storage engine (lib/core/storage.js) works incorrect. Stores data to my vuex store, but can't read from state directly.
While token seems to be stored using setUniversal/getUniversal, and is correctly setted in nuxt-axios instance headers.
if I add console log in lib/core/auth.js
setUser
andget user ()
I see following after call login:after refreshing page Cmd+R data reveals correctly.
The text was updated successfully, but these errors were encountered: