Skip to content

Commit

Permalink
chore: redirect landing page (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
crlssn authored Dec 12, 2024
1 parent 0f42d9a commit 7a75553
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions web/src/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ const router: Router = createRouter({
name: 'reset-password',
path: '/reset-password',
},
{
// TODO: Create a landing page.
beforeEnter: [landing],
children: [],
component: null,
name: 'landing',
path: '/',
},
{
component: () => import('@/ui/NotFound.vue'),
meta: { title: 'Not Found' },
Expand Down Expand Up @@ -219,4 +227,10 @@ async function logout() {
}
}

async function landing() {
const authStore = useAuthStore()
if (authStore.accessToken) return { path: '/home' }
return { path: '/login' }
}

export default router

0 comments on commit 7a75553

Please sign in to comment.