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

Allow access to HTTP response status code on OAuthServerException. #1148

Merged

Conversation

crynobone
Copy link
Member

@crynobone crynobone commented Dec 26, 2019

This would allow custom exception handler such as dingo/api to retrieved proper HTTP status code when rendering exception.

use Laravel\Passport\Exceptions\OAuthServerException;

// ...

tap($this->app->make('api.exception'), static function ($handler) {
    $handler->register(static function (OAuthServerException $e) {
        return abort($e->getStatusCode(), $e->getMessage());
    });
});

Signed-off-by: Mior Muhammad Zaki [email protected]

@taylorotwell taylorotwell merged commit b5e9198 into laravel:8.x Dec 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants