Catching exception from oauth
- Dominant language
- PHP
- Stars
- 9.4k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Hi
I'm using dingo with and oauth2 to authenticate my users. All is good, a part form I'm getting an exception when I pass in incorrect details:
League\OAuth2\Server\Exception\InvalidCredentialsException: The user credentials were incorrect.
I already have a couple of dingo handlers, so I thought I'd have the following:
$app['Dingo\Api\Exception\Handler']->register(function
(\League\OAuth2\Server\Exception\InvalidCredentialsException $exception) {
return Response()->json([
'errors' => [
'status' => 400,
'title' => 'Bad Request',
'message' => 'The user credentials were incorrect'
]
], 400);
});
But for some reason, this handler doesn't seem to handle the exception
Am i going about this correctly?
Contributor guide
Assessment
This issue has not been assessed yet.