mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
13 lines
284 B
JavaScript
13 lines
284 B
JavaScript
const addNavigationGuards = (router, store) => {
|
|
router.beforeEach((to, from, next) => {
|
|
// handle authentication
|
|
if (to.meta.requiresAuth && !store.state.token) {
|
|
next({ path: '/not-found' })
|
|
} else {
|
|
next()
|
|
}
|
|
})
|
|
}
|
|
|
|
export default addNavigationGuards
|