diff --git a/app/middleware/profile.global.ts b/app/middleware/profile.global.ts index d077317..518b4f7 100644 --- a/app/middleware/profile.global.ts +++ b/app/middleware/profile.global.ts @@ -6,10 +6,16 @@ export default defineNuxtRouteMiddleware(async (to) => { const rawPath = to?.path ?? '' const normalizedPath = rawPath.startsWith('/') ? rawPath : `/${rawPath}` + const fullPath = to?.fullPath ?? normalizedPath const routeName = typeof to?.name === 'string' ? to.name : '' - const isProfilesRoute = normalizedPath.startsWith('/profiles') || routeName.startsWith('profiles') + const isProfilesRoute = + normalizedPath.startsWith('/profiles') || + fullPath.startsWith('/profiles') || + routeName.startsWith('profiles') if (!activeProfile.value && !isProfilesRoute) { - return navigateTo('/profiles') + if (!normalizedPath.startsWith('/profiles')) { + return navigateTo('/profiles') + } } })