Преглед изворни кода

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 месеци
родитељ
комит
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() ?? ''
 
     // <<- TODO: remove after 2.6 release
+    const inDevPages = []
+
     const runtimeConfig = useRuntimeConfig()
     if (
       runtimeConfig.public.env === 'production' &&
-      name === 'cmf_licence_page'
+      inDevPages.includes(name)
     ) {
       const { redirectToHome } = useRedirect()
       redirectToHome()