Commit 37c057ea authored by Anton's avatar Anton

Always check session before route change

parent 9ed6188a
Pipeline #19622 passed with stage
in 2 minutes and 16 seconds
......@@ -28,7 +28,6 @@ Router.beforeEach((to, from, next) => {
else cb()
}
waitForStore(Router.app, () => {
if (!Router.app.$store.state.auth.user) {
Router.app.$auth.checkSession(Router.app.$store).catch(() => {
if (to.meta.private) {
Router.app.$store.commit('auth/setRedirect', to.fullPath)
......@@ -61,14 +60,6 @@ Router.beforeEach((to, from, next) => {
Router.app.$captureException(err)
Router.app.$auth.logout()
})
}
else {
if (to.meta.feature) {
if (userHasFeature(Router.app.$store.state.auth.user, to.meta.feature)) next()
else next({ name: 'site.welcome' })
}
next()
}
})
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment