Describe the feature
Problem: The globalAppMiddleware: true option (which protects all routes requiring login) is set conditionally in nuxt.config.ts at build time. Instances that require mandatory login and those that allow guest access cannot share the same build.
Use case: Single build, multiple instances — some require login to browse (isLoginRequiredToAccess=true), others allow guest access. This is currently controlled by a JSON config file read at build time.
Expected behavior: Allow globalAppMiddleware behavior to be driven by a runtimeConfig value (e.g. NUXT_AUTH_GLOBAL_MIDDLEWARE=true), so the middleware reads the flag at request time and decides whether to enforce authentication, rather than the middleware being registered or not at compile time.
Note: We are aware this may require architectural changes since Nuxt middleware registration happens at build time. An alternative acceptable solution would be a "compile-in but runtime-skippable" global middleware that checks a runtimeConfig boolean before enforcing auth.
How would you implement this?
No response
Additional information
Provider
Describe the feature
Problem: The globalAppMiddleware: true option (which protects all routes requiring login) is set conditionally in nuxt.config.ts at build time. Instances that require mandatory login and those that allow guest access cannot share the same build.
Use case: Single build, multiple instances — some require login to browse (isLoginRequiredToAccess=true), others allow guest access. This is currently controlled by a JSON config file read at build time.
Expected behavior: Allow globalAppMiddleware behavior to be driven by a runtimeConfig value (e.g. NUXT_AUTH_GLOBAL_MIDDLEWARE=true), so the middleware reads the flag at request time and decides whether to enforce authentication, rather than the middleware being registered or not at compile time.
Note: We are aware this may require architectural changes since Nuxt middleware registration happens at build time. An alternative acceptable solution would be a "compile-in but runtime-skippable" global middleware that checks a runtimeConfig boolean before enforcing auth.
How would you implement this?
No response
Additional information
Provider