Skip to content

Commit

Permalink
Pass user identifier through to finalize scopes in personal access gr…
Browse files Browse the repository at this point in the history
…ant (#1650)
  • Loading branch information
GrahamCampbell authored Apr 4, 2023
1 parent ef5fa30 commit 5417fe8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Bridge/PersonalAccessGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,22 @@ public function respondToAccessTokenRequest(
// Validate request
$client = $this->validateClient($request);
$scopes = $this->validateScopes($this->getRequestParameter('scope', $request));
$userIdentifier = $this->getRequestParameter('user_id', $request);

// Finalize the requested scopes
$scopes = $this->scopeRepository->finalizeScopes($scopes, $this->getIdentifier(), $client);
$scopes = $this->scopeRepository->finalizeScopes(
$scopes,
$this->getIdentifier(),
$client,
$userIdentifier
);

// Issue and persist access token
$accessToken = $this->issueAccessToken(
$accessTokenTTL, $client,
$this->getRequestParameter('user_id', $request), $scopes
$accessTokenTTL,
$client,
$userIdentifier,
$scopes
);

// Inject access token into response type
Expand Down

0 comments on commit 5417fe8

Please sign in to comment.