diff --git a/middleware/auth.global.ts b/middleware/auth.global.ts new file mode 100644 index 0000000..851dc4c --- /dev/null +++ b/middleware/auth.global.ts @@ -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"); + } +});