+2
-2
@@ -100,8 +100,8 @@ const router = createRouter({
|
||||
|
||||
router.beforeEach((to) => {
|
||||
const auth = useAuthStore()
|
||||
if (!to.meta.public && !auth.isAuthed) return { name: 'login', query: { redirect: to.fullPath } }
|
||||
if (to.name === 'login' && auth.isAuthed) return { name: 'overview' }
|
||||
if (!to.meta.public && !auth.isAuthed()) return { name: 'login', query: { redirect: to.fullPath } }
|
||||
if (to.name === 'login' && auth.isAuthed()) return { name: 'overview' }
|
||||
return true
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user