mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
only one navigation guard in main.js
This commit is contained in:
parent
faa07235bc
commit
fca0c7627e
@ -1,7 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import routes from './routes'
|
||||
import { store } from '../store/store'
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
@ -21,12 +20,4 @@ const router = new VueRouter({
|
||||
},
|
||||
})
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.meta.requiresAuth && !store.state.session_id) {
|
||||
next({ path: '/login' })
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user