-
Notifications
You must be signed in to change notification settings - Fork 122
Closed
Description
How access store in beforeEnter ?
// main.js
import store from './store'
import router from './router'
import { sync } from 'vuex-router-sync'
sync(store, router)// routes.js
function requireAuth (to, from, next) {
if (!store.getters.isAuthenticated) { /// THIS NOT WORK, HOW TO ACCESS STORE?
window.location.href = '/auth/v1/auth0/connect'
} else {
next()
}
}
export default [
{
path: '/', component: Timeline
},
{
path: '/events',
component: Events,
beforeEnter: requireAuth
}
]Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels