Open atinux opened 3 years ago
Also, the token in the localStorage and cookie is undefinedtoken
because I specific localStorage: true
:
I can confirm the bug with store disabled. We indeed need to use observable (and probably also document better about initialState)
Auth module uses same implementation which is probably affected: https://github.com/nuxt-community/auth-module/blob/83adce54190f097a965a33787f96faf9eb479f97/src/core/storage.ts#L116
Also, the token in the localStorage and cookie is
undefinedtoken
because I specificlocalStorage: true
:
I guess you need to specify prefix in options like this:
localStorage: {
prefix: 'some-prefix-',
},
I tried a demonstration using CodeSandBox with disabling Vuex.
https://codesandbox.io/s/flamboyant-browser-cpucn?file=/pages/index.vue
I actually have to call
$forceUpdate()
in the component, It's weird since we use Vue.set(), maybe we should define the state using Vue.observable ?