1
votes

I'm using Laravel/Passport for authentication for my REST-API.

I have my app set up localy, and on a test server and I've already configured Passport.

I'have my routes protected with auth:api guard , but i've noticed that when i want to access protected route & wrong/expired access token is provided in the header ( Authorization:Beraer <wrong_token> ), it returns 500 error with no response at all.

This happens only on the test server ( localy it works perfect ). I've tried to re-configure Passport , cleared caches, but nothing seems to help.

1
Check your server error logs - Saad Suri
I've looked at the storage/logs/laravel.log file and there is nothing helpful. Last error occurred an hour ago ( it's not related ). - lcadc17
Sorry for fast response, i've found this error log : PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in vendor/league/oauth2-server/src/Exception/OAuthServerException.php on line 168 - lcadc17

1 Answers

2
votes

so i found the acctual issue here on github https://github.com/laravel/passport/issues/440 and as a solution, you can add \League\OAuth2\Server\Exception\OAuthServerException::class, to the $dontReport array ( probably this occured , because i've updated passport package )