Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

globalAppMiddleware: true behaves differently to globalAppMiddleware: { isEnabled: true } #527

Closed
Timbological opened this issue Sep 14, 2023 · 0 comments · Fixed by #528

Comments

@Timbological
Copy link
Contributor

Environment

[3:19:41 pm] Nuxi 3.6.5
[3:19:41 pm]
[3:19:41 pm] Nuxt project info:


  • Operating System: Linux
  • Node Version: v20.5.1
  • Nuxt Version: 3.6.5
  • Nitro Version: 2.6.2
  • Package Manager: npm@9.8.0
  • Builder: vite
  • Runtime Modules: @nuxt/devtools@0.7.6
  • Build Modules: -

Reproduction

Set auth: { globalAppMiddleware: true } in nuxt.config.ts
Create page with auth disabled with link to another page (protected due to globalAppMiddleware)
Go to unprotected page while signed out and click link to protected page
Login, you will be redirected to the original page not the protected page

Also go to non-existent page while signed out and you will be redirected to sign in

Describe the bug

setting globalAppMiddleware:true in nuxt.config.ts results in different behaviour to setting globalAppMiddleware: { isEnabled: true }, this is unintuitive and not clear in documentation

addDefaultCallbackUrl and allow404WithoutAuth both behave as false if globalAppMiddleware:true is set but true if globalAppMiddleware: { isEnabled: true } is set

PR is open

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant