quasar router authentication example
Example: quasar router authentication
export default function ({ store /*, ssrContext */ }) {
// ...
Router.beforeEach((to, from, next) => {
if (to.matched.some(record => record.meta.requireAuth) && !store.getters['auth/isSignedIn']) {
next({ name: 'account-signin', query: { next: to.fullPath } })
} else {
next()
}
})
// ...
}