-
Notifications
You must be signed in to change notification settings - Fork 789
Closed
Labels
Description
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:
passport/src/Http/Controllers/AuthorizedAccessTokenController.php
Lines 35 to 42 in 4e3390e
| public function forUser(Request $request) | |
| { | |
| $tokens = $this->tokenRepository->forUser($request->user()->getKey()); | |
| return $tokens->load('client')->filter(function ($token) { | |
| return ! $token->client->firstParty() && ! $token->revoked; | |
| })->values(); | |
| } |
passport/src/Http/Controllers/AuthorizationController.php
Lines 107 to 116 in 55c1c54
| protected function approveRequest($authRequest, $user) | |
| { | |
| $authRequest->setUser(new User($user->getKey())); | |
| $authRequest->setAuthorizationApproved(true); | |
| return $this->convertResponse( | |
| $this->server->completeAuthorizationRequest($authRequest, new Psr7Response) | |
| ); | |
| } |
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?