fix: limit profile redirect middleware to client

This commit is contained in:
Matthieu
2025-09-18 08:44:38 +02:00
parent ac948bbf5e
commit 45356ec3ae

View File

@@ -13,9 +13,7 @@ export default defineNuxtRouteMiddleware(async (to) => {
fullPath.startsWith('/profiles') ||
routeName.startsWith('profiles')
if (!activeProfile.value && !isProfilesRoute) {
if (!normalizedPath.startsWith('/profiles')) {
return navigateTo('/profiles')
}
if (process.client && !activeProfile.value && !isProfilesRoute) {
return navigateTo('/profiles')
}
})