Skip to content

Commit

Permalink
chore: update navigation guards
Browse files Browse the repository at this point in the history
  • Loading branch information
wrzrmzx committed Feb 22, 2024
1 parent c902481 commit 3aa2845
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/navigationGuards.global.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default defineNuxtRouteMiddleware(async (to, from) => {
const auth = await useAuth()

if (to.path === '/notification' && !auth.isLogin)
if (to.meta.requiresAuth && !auth.isLogin)
return navigateTo('/')
})
1 change: 1 addition & 0 deletions pages/notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ definePageMeta({
route.query.noteType,
]),
layout: false,
requiresAuth: true
})
const route = useRoute()
Expand Down

0 comments on commit 3aa2845

Please sign in to comment.