designmynight / laravel-mongodb-passport

A package to get Laravel Passport working with MongoDB
MIT License
67 stars 75 forks source link

Not working with laravel 5.6 and Jenssegers Mongodb #11

Closed BurpyDelivers closed 6 years ago

BurpyDelivers commented 6 years ago

When I am trying to generate token for a user (oath/token), it always say invalid clientid, it is not able to pick _id as id, when I am adding a field id with the same value in the "oauth_clients" collection it works. Please suggest.

StevePorter92 commented 6 years ago

What version of Laravel and Passport are you using?

denudge commented 6 years ago

I have the same problem, it is in Laravel\Passport\ClientRepository.

public function find($id)
{
    return Passport::client()->where('id', $id)->first();
}

When I change it to Passport::client()->find($id)->first(); it works.

robbytaylor commented 6 years ago

This is an issue with Laravel Passport 6. A change introduced in https://github.com/laravel/passport/pull/715 hardcoded the ID field as id. A change to fix that issue has been merged in https://github.com/laravel/passport/pull/745 but a new version of Passport hasn't been tagged since then.

As a work around you could update your composer.json file to constrain passport to commit a3a1c5d3c2aa1635dd2c01063b7b0fff7225b88b

StevePorter92 commented 6 years ago

Thanks @robbytaylor

denudge commented 6 years ago

It's been merged into laravel/passport 6.0.3. No need for a workaround. Thx!