-
Notifications
You must be signed in to change notification settings - Fork 509
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
docs(routing): add note about middleware returns #1884
Conversation
Better describe middleware and how returning within it behaves
β Live Preview ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Why is this not recommended to do? Unauthenticated reauests can be ended before they reach other handlers with this. |
Yes, also this breaks the nitro request handling lifecycle (i am planning also to introduce |
Oh okay. Is there any method that would allow for this, to just directly respond to unauthenticated requests with 401s in one place? |
You can throw an error like |
Better describe middleware and how returning within it behaves
β Type of change
π Description
This improves on documentation. Before it stated that they should not return anything, which is untrue - returning from middleware returns the value as a response.
π Checklist