Przeglądaj źródła

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 miesięcy temu
rodzic
commit
abdcaa0d65
1 zmienionych plików z 3 dodań i 1 usunięć
  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()