Middleware does not work while using zones #5932
datteroandrea
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description 📓
It would be appropriate to allow middleware functions to work even in zones, let's say I have a main application (app1) to handle authentication and a sub-application (app2) running in a subroute that is using the cookie of app1 to authenticate and autorize the user.
The middleware is not working in app2, this is the following middleware function:
The middleware is in this specific path: /middleware/auth-guard.ts
The middleware function is never run when accessing those paths and "test" is never printed.
How to reproduce ☕️
Create a next-auth-example app.
Create a sub-application running in a sub-path of the main application that uses the cookies of the main app for authentication.
Create a middleware function as shown above for the sub-application.
Contributing 🙌🏽
Yes, I am willing to help implement this feature in a PR
Beta Was this translation helpful? Give feedback.
All reactions