Passport: Use getAuthIdentifier() instead of getKey() to retrieve current user identifier

Created on 19 Apr 2019  ·  1Comment  ·  Source: laravel/passport

In core framework, getAuthIdentifier() is used to get user identifier for authentication.
However, in passport getKey() is used to get user identifier.

Below are the places where made us confused:
https://github.com/laravel/passport/blob/4e3390e67a5a74850698e1e991fd324b4dfa0ffa/src/Http/Controllers/AuthorizedAccessTokenController.php#L35-L42
https://github.com/laravel/passport/blob/55c1c546332db7bbbb95e0e4fd50ee8a690afc11/src/Http/Controllers/AuthorizationController.php#L107-L116

In our case, we used uuid as auth identifier but kept primary key as $primaryKey field for relationships.

Would you consider to change to use getAuthIdentifier() to be in sync with core framework design?

enhancement

Most helpful comment

Hmm yes I believe so but we'd have to make the change on the next major release.

>All comments

Hmm yes I believe so but we'd have to make the change on the next major release.

Was this page helpful?
0 / 5 - 0 ratings