export default defineNuxtRouteMiddleware((to) => { // Skip middleware for coop-planner, wizards, templates, and API routes if ( to.path === "/coop-planner" || to.path === "/wizards" || to.path.startsWith("/templates") || to.path.startsWith("/api/") ) { return; } // Use actual store state to determine whether setup is complete const membersStore = useMembersStore(); const policiesStore = usePoliciesStore(); const streamsStore = useStreamsStore(); const setupComplete = membersStore.isValid && policiesStore.isValid && streamsStore.hasValidStreams; if (!setupComplete) { return navigateTo("/coop-planner"); } });