فهرست منبع

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()