Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/Grant/RefreshTokenGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ public function respondToAccessTokenRequest(
}
}

$scopes = $this->scopeRepository->finalizeScopes($scopes, $this->getIdentifier(), $client);
$userId = $oldRefreshToken['user_id'];
if (is_int($userId)) {
$userId = (string) $userId;
}

$scopes = $this->scopeRepository->finalizeScopes($scopes, $this->getIdentifier(), $client, $userId);

// Expire old tokens
$this->accessTokenRepository->revokeAccessToken($oldRefreshToken['access_token_id']);
Expand All @@ -78,10 +83,6 @@ public function respondToAccessTokenRequest(
}

// Issue and persist new access token
$userId = $oldRefreshToken['user_id'];
if (is_int($userId)) {
$userId = (string) $userId;
}
$accessToken = $this->issueAccessToken($accessTokenTTL, $client, $userId, $scopes);
$this->getEmitter()->emit(new RequestAccessTokenEvent(RequestEvent::ACCESS_TOKEN_ISSUED, $request, $accessToken));
$responseType->setAccessToken($accessToken);
Expand Down
2 changes: 1 addition & 1 deletion tests/Grant/RefreshTokenGrantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ public function testRespondToRequestFinalizeScopes(): void
$scopeRepositoryMock
->expects(self::once())
->method('finalizeScopes')
->with($scopes, $grant->getIdentifier(), $client)
->with($scopes, $grant->getIdentifier(), $client, '123', null)
->willReturn($finalizedScopes);

$accessToken = new AccessTokenEntity();
Expand Down