Closed RyeBot33 closed 3 years ago
Hi,
Sorry for the wait! I've been away from OSS for a while.
Pathify is mainly designed to clean up the store and components, so in the router you can just access the store as you would otherwise:
import store from './store'
...
router.beforeEach((to, from, next) => {
if (!store.state.app.authenticated) {
next(false)
}
})
Hope that helps.
Have a module called app.js and the state looks something like this:
const state = { authenticated = false }
const mutations = make.mutations(state);
const getters = { ...make.getters(state) };
With a login page that has computed property setup with
...sync("app", ["authenticated"])
that I am setting with an @click="authenticated = true"
How could I set up a navigation guard in vue router to access this store property? I feel like it is simple, but not sure.