|
|
|
@ -23,6 +23,9 @@ import { useGlobal } from '#imports'
|
|
|
|
|
export default defineNuxtRouteMiddleware((to, from) => { |
|
|
|
|
const state = useGlobal() |
|
|
|
|
|
|
|
|
|
/** if shred base allow without validating token */ |
|
|
|
|
if (to.params?.projectType === 'base') return |
|
|
|
|
|
|
|
|
|
/** if auth is required or unspecified (same as required) and user is not signed in, redirect to signin page */ |
|
|
|
|
if ((to.meta.requiresAuth || typeof to.meta.requiresAuth === 'undefined') && !state.signedIn.value) { |
|
|
|
|
return navigateTo('/signin') |
|
|
|
|