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

[5.8] Modify RedirectIfAuthenticated middleware to accept multiple guards #4904

Conversation

amaelftah
Copy link
Contributor

Same as #3685 , this will allows to

Route::get('foo', 'Foo@foo')->middleware('guest:web,api');

@gpressutto5
Copy link
Contributor

Why redirecting an api request?

@amaelftah
Copy link
Contributor Author

@gpressutto5 it's just an example , but in real case scenarios we maybe doing this

Route::get('admins-only-login-form', 'AdminController@loginForm')->middleware('guest:admin,moderators,users');

@ludo237
Copy link

ludo237 commented Jan 15, 2019

That makes sense, we have already edited this in one of our project for the same reason

@taylorotwell
Copy link
Member

Why did you also change the redirect URL?

@taylorotwell taylorotwell merged commit 2d2c089 into laravel:develop Jan 16, 2019
@amaelftah
Copy link
Contributor Author

@taylorotwell sorry changed by mistake

@tomhorvat
Copy link
Contributor

tomhorvat commented Feb 23, 2019

@taylorotwell @Te7a-Houdini

Does this break 'guest' middleware? I'm able to access /login on clean 5.8-dev install without redirect...

Tested on fresh install, twice.

tomhorvat added a commit to tomhorvat/laravel that referenced this pull request Feb 24, 2019
After laravel#4904 guest middleware should have guard parameter to work as intended
tomhorvat added a commit to tomhorvat/laravel that referenced this pull request Feb 24, 2019
After laravel#4904 guest middleware should have guard parameter to work as intended
tomhorvat added a commit to tomhorvat/laravel that referenced this pull request Feb 24, 2019
After laravel#4904 guest middleware should have guard parameter to work as intended
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants