Просмотр исходного кода

Updates route middleware for development pages

Updates the route middleware to handle development-specific pages based on the environment.

This change introduces an `inDevPages` array to control access to certain routes based on the environment configuration.
This allows for better control over feature availability during development and production stages.
Olivier Massot 10 месяцев назад
Родитель
Сommit
abdcaa0d65
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      middleware/routing.global.ts

+ 3 - 1
middleware/routing.global.ts

@@ -16,10 +16,12 @@ export default defineNuxtRouteMiddleware((to, _) => {
     const name: string = routeName?.toString() ?? ''
     const name: string = routeName?.toString() ?? ''
 
 
     // <<- TODO: remove after 2.6 release
     // <<- TODO: remove after 2.6 release
+    const inDevPages = []
+
     const runtimeConfig = useRuntimeConfig()
     const runtimeConfig = useRuntimeConfig()
     if (
     if (
       runtimeConfig.public.env === 'production' &&
       runtimeConfig.public.env === 'production' &&
-      name === 'cmf_licence_page'
+      inDevPages.includes(name)
     ) {
     ) {
       const { redirectToHome } = useRedirect()
       const { redirectToHome } = useRedirect()
       redirectToHome()
       redirectToHome()