I am using Laravel Passport's Authorization Code Grant to authenticate users. I want to return a JSON response if the access token is expired when accessing an "auth:api" middleware protected route.
The problem is that I can't get Laravel\Passport\Exceptions\OAuthServerException to render in Handler.php. Instead I get League\OAuth2\Server\Exception\OAuthServerException only in report method. The passport guide said that I should try to handle Passport's OAuthServerException instead of https://github.com/laravel/passport/blob/11.x/UPGRADE.md#renderable-exceptions-for-oauth-errors