import { useAuthStore } from "~/stores/authStore" export default defineNuxtRouteMiddleware(async (to) => { if ( !process.server && to.meta.layout === "admin" && to.name !== "admin-login" && !(await useAuthStore().isLogged) ) { return navigateTo("/admin/login") } })