-
Notifications
You must be signed in to change notification settings - Fork 531
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
Handle exceptions in 5.2, Closes lucadegasperi/oauth2-server-laravel#641 #653
Conversation
@mstephens Great! Thanks! |
PS. If you're now using Middleware groups, make sure this Middleware is the first in your list :] |
} catch (OAuthException $e) { | ||
$data = [ | ||
'error' => $e->errorType, | ||
'error_description' => $e->getMessage(), | ||
]; | ||
|
||
return new JsonResponse($data, $e->httpStatusCode, $e->getHttpHeaders()); | ||
return response()->json($data, $e->httpStatusCode, $e->getHttpHeaders()); |
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.
Please use the class instead of the helper method.
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.
@vinkla reverted back 👍
@mstephens That works fine for me, Thanks so much!! |
@mstephens could you please squash your commits? |
@vinkla, sure there you go |
@mstephens Thanks! |
It no longer throws exceptions through middleware, but instead returns a valid response with the exception set on it see: lucadegasperi/oauth2-server-laravel#653
Hello guys. Is this pull request will be merged in the repository? It seems to solve the issue. Thanks! |
Handle exceptions in 5.2, Closes lucadegasperi/oauth2-server-laravel#641
Thanks @mstephens! |
Thank you guys! Nice job @mstephens. |
When is this commit going to appear in a release? I desperately need this fix in my application. Currently I am using the latest 5.1.3 release and this merge happens after that. :/ |
It is added in 5.1.4 |
Of your composer.json file |
I'm using v This section of the documentation suggests that the With the changes to #654 |
Hi guys
This fixes the changes made in Laravel 5.2.7 onwards regarding the way in which middleware is handled via the routing pipeline.
Cheers