Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
router.beforeEach((to, from, next) => {
const requiresAuth = to.matched.some(record => {
return record.meta.requiresAuth
})
if (requiresAuth && !store.$data.isRegistered) {
next('/login')
} else {
next()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.