Skip to content

Commit

Permalink
feat: ✨ Begin auth middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
RihanArfan committed Jun 6, 2023
1 parent 251bbd8 commit 343ba24
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions middleware/auth.global.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default defineNuxtRouteMiddleware((to, from) => {
const IS_LOGGED_IN = true;

// TODO: exclude routes that don't require authentication

if (!IS_LOGGED_IN) {
return navigateTo("/login");
}
});

0 comments on commit 343ba24

Please sign in to comment.