You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Nuxt Bridge, when a middleware uses the navigateTo(), abortNavigation() utility to redirect the user, the middleware chain does not break as expected. This behavior results in subsequent middlewares being called, potentially leading to errors. This issue is particularly problematic in scenarios where a root middleware checks for user authentication and attempts to block access to a page.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Hey @wattanx thank you for the quick response.
I think the issue that you've linked describes another bug, which is order in which middlewares are called.
The issue I'm describing is that child middleware shouldn't be called at all.
I setup redirects just for demonstration purposes in my repo.
dashboard: has authorize middleware, and then load-data middleware
authorized middleware always redirects user to home page because user is not authorized.
and expected behavior is that load-data middleware woudn't be called since aurthorize return navigateTo.
But load-data called anyway
If you go to /dashboard page you will see in console
>>> Authorization middleware called
>>> Load data middleware called
Environment
Reproduction
Reproduction repo: https://github.com/atomiomi/nuxt-bridge-middlewares
The repo has README with steps to reproduce
Describe the bug
In Nuxt Bridge, when a middleware uses the navigateTo(), abortNavigation() utility to redirect the user, the middleware chain does not break as expected. This behavior results in subsequent middlewares being called, potentially leading to errors. This issue is particularly problematic in scenarios where a root middleware checks for user authentication and attempts to block access to a page.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: