From 95c1e665203973d876483eb6cd7420817f32743f Mon Sep 17 00:00:00 2001 From: Matthieu Date: Thu, 18 Sep 2025 08:30:29 +0200 Subject: [PATCH] fix: guard profile middleware on profiles routes --- app/middleware/profile.global.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/middleware/profile.global.ts b/app/middleware/profile.global.ts index 32b36a5..bd589b4 100644 --- a/app/middleware/profile.global.ts +++ b/app/middleware/profile.global.ts @@ -4,7 +4,9 @@ export default defineNuxtRouteMiddleware(async (to) => { const { ensureSession, activeProfile } = useProfileSession() await ensureSession() - const isProfilesRoute = to.path.startsWith('/profiles') + const path = to.path || '' + const routeName = typeof to.name === 'string' ? to.name : '' + const isProfilesRoute = path.startsWith('/profiles') || routeName.startsWith('profiles') if (!activeProfile.value && !isProfilesRoute) { return navigateTo('/profiles')