dusterio / lumen-passport

Making Laravel Passport work with Lumen
MIT License
655 stars 141 forks source link

Memory leak in OAuthServerException.php #86

Closed ThamanVelasquezBice closed 2 years ago

ThamanVelasquezBice commented 6 years ago

I am unsure if this is related to this package or Laravel passport in general. I followed the install instructions and went to test a random route with the auth middleware. I received this error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /Users/thaman/Documents/Code/my-project/vendor/league/oauth2-server/src/Exception/OAuthServerException.php on line 173

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /Users/thaman/Documents/Code/my-project/vendor/symfony/debug/Exception/FatalErrorException.php on line 1

this is the function located in that file on that line:

public static function accessDenied($hint = null, $redirectUri = null)
    {
        return new static(
            'The resource owner or authorization server denied the request.',
            9,
            'access_denied',
            401,
            $hint,
            $redirectUri
        );
    }

I am on Lumen 5.4

ThamanVelasquezBice commented 6 years ago

More details: it only happens when the route is hit without proper authentication. An example would be with having an incorrect access_token.

It was referenced a while back in the oauth2-server package that Passport uses: https://github.com/thephpleague/oauth2-server/issues/784