/** * Auth bootstrap plugin — runs before any page renders. * Restores the auth session from the httpOnly cookie on page load/refresh. * If the cookie is valid, fetchProfile() populates auth.user. * If expired or missing, auth.user stays null → layout guard redirects to /login. */ export default defineNuxtPlugin(async () => { const auth = useAuthStore() if (!auth.user) { await auth.fetchProfile() } })