dusterio / lumen-passport

Making Laravel Passport work with Lumen
MIT License
654 stars 139 forks source link

Unable to resolve dependency [Parameter #1 [ <required> $tokenId ]] in class Laravel\Passport\Http\Controllers\AuthorizedAccessTokenController #154

Closed santilorenzo closed 3 years ago

santilorenzo commented 3 years ago

Dependencies:

"dusterio/lumen-passport": "^0.3.2"
"laravel/passport": "^10.1"

When I call DELETE http://sample-app.localhost/oauth/tokens/ef928eb507f73...

I get this exception: Unable to resolve dependency [Parameter #1 [ <required> $tokenId ]] in class Laravel\Passport\Http\Controllers\AuthorizedAccessTokenController

I found out that it's because of the line 64 in the Route Registrar: $this->app->delete('/tokens/{token_id}', $this->prefix('AuthorizedAccessTokenController@destroy'));

By changing to $this->app->delete('/tokens/{tokenId}', $this->prefix('AuthorizedAccessTokenController@destroy')); it works.

Not sure if it is back compatible with older passport versions so I'm not sure if I should make a pull request

dusterio commented 3 years ago

@santilorenzo can you please make a pull request. if somebody wants to stay on older Passport - they can lock in version in the composer file anyway :)

santilorenzo commented 3 years ago

Ok perfect, I submitted the PR 👍

dusterio commented 3 years ago

@santilorenzo merged, thanks!

santilorenzo commented 3 years ago

Sorry for the double PR, but I realized that also the other methods must be updated :(