-
Hello, In my Vue app I am using Vuex store to store isLoggedIn in main.ts after creating the Vue app I am listening for a change in Auth state
With Vue-Router I have a beforeEnter hook that checks the state in the store and redirect whether it's logged in or not. the problem is that the router hook is running before the session change triggers. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I couldn't check beforeEnter the status of the user so now I have the following Mixin
and in every view I add this Mixin
I don't know if there is a better way for this. One advantage of this is that it works also with multiple tabs if you have something like vuex-multi-tab-state used with vuex store. |
Beta Was this translation helpful? Give feedback.
I couldn't check beforeEnter the status of the user so now I have the following Mixin
and in every view I add this Mixin
I don't know if there is a better way for this.
One advantage of this is that it works also with multiple tabs if …