initial commit

This commit is contained in:
LiamPietralla committed 2025-01-10 08:37:18 +11:00
commit f577617b4d
80 files changed
+10113

No files matched your search

@@ -0,0 +1,9 @@
const anonymousRoutes = ['/login', '/health'];
export default defineNuxtRouteMiddleware((to, from) => {
// If the route is not the login page and the user is not logged in then redirect to login
const authenticated = useCookie<boolean>('authenticated');
if (!anonymousRoutes.includes(to.path) && !(authenticated.value) ) {
return navigateTo('/login');
}
})