From 5417fe870a1a76628c13c79ce4c9b6fbea429bc0 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Tue, 4 Apr 2023 15:06:53 +0100 Subject: [PATCH] Pass user identifier through to finalize scopes in personal access grant (#1650) --- src/Bridge/PersonalAccessGrant.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Bridge/PersonalAccessGrant.php b/src/Bridge/PersonalAccessGrant.php index 289a0257a..4eb5f869c 100644 --- a/src/Bridge/PersonalAccessGrant.php +++ b/src/Bridge/PersonalAccessGrant.php @@ -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