Allow custom middlewares into EnsureFrontendRequestsAreStateful#561
Closed
coppolafab wants to merge 1 commit intolaravel:4.xfrom
Closed
Allow custom middlewares into EnsureFrontendRequestsAreStateful#561coppolafab wants to merge 1 commit intolaravel:4.xfrom
coppolafab wants to merge 1 commit intolaravel:4.xfrom
Conversation
Member
|
I am closing this pull request because it lacks sufficient explanation, tests, or both. It is difficult for us to merge pull requests without these things because the change may introduce breaking changes to the framework. Feel free to re-submit your change with a thorough explanation of the feature and tests - integration tests are preferred over unit tests. Please include it's benefit to end users; the reasons it does not break any existing features; how it makes building web applications easier, etc. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables the use of customized middlewares with EnsureFrontendRequestsAreStateful.
In a Laravel project where Illuminate\Session\Middleware\StartSession is replaced with a custom middleware, EnsureFrontendRequestsAreStateful was still using the default middleware.
This change will benefit developers who want to replace the default middlewares with their custom implementations.
Problem Description
In a Laravel + Sanctum project configured as follows:
The routes under api group does not use the custom StartSession, and EnsureFrontendRequestsAreStateful uses the default hardcoded middleware. This forces developers to copy and paste the frontendMiddleware method, risking it becoming out of sync with future updates to Sanctum.
Additionally, all other middleware used by EnsureFrontendRequestsAreStateful are already configurable.