-
Notifications
You must be signed in to change notification settings - Fork 703
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
Symfony FOSRestBundle redirecting to login on 401 Exceptions since upgrade #1848
Comments
I think it does not relate to the bundle. You should look at the problem in your tests.. |
Tests are fine and there is no reason why they should fail if they didn't just before the update. The only thing that changed on this regard is the FOSRestBundle upgrade... |
Does anyone know a nice bundle for RestApis like FOS but that works then ? |
@FabulousCo Example config:
|
@enricog84's answer helped but with a higher priority. It's sad that we have to build a custom ExceptionListener to prevent redirection on requests to the REST API since it's supposed to be the default behavior... |
Thanks for the confirmation. This at least means, that the decoration approach we favour will probably solve our issues. |
Is there a more complete example for a workaround for this? |
This has been fixed in 9e10690 (tested in 2.8.1) |
I upgraded my FOSRestBundle from version 1.* to 2.*
And since this upgrade many of my tests are failing because all expected 401 responses have been switched to 302 responses (redirections to the login page).
I know many people had this issue but didn't find any fix that works on my project.
Here is what I currently have:
config.yml:
ExceptionController:
I'm on Symfony3.2
Any Ideas ?
The text was updated successfully, but these errors were encountered: