From fda18e1b11d5fdb405edc80fc91b7105ea70c3d6 Mon Sep 17 00:00:00 2001 From: Phillip Look Date: Fri, 7 Jun 2024 14:58:41 +0200 Subject: [PATCH] Pass user id from old refresh token to finalizeScopes() --- src/Grant/RefreshTokenGrant.php | 2 +- tests/Grant/RefreshTokenGrantTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Grant/RefreshTokenGrant.php b/src/Grant/RefreshTokenGrant.php index a632990c7..cf8702d65 100644 --- a/src/Grant/RefreshTokenGrant.php +++ b/src/Grant/RefreshTokenGrant.php @@ -69,7 +69,7 @@ public function respondToAccessTokenRequest( } } - $scopes = $this->scopeRepository->finalizeScopes($scopes, $this->getIdentifier(), $client); + $scopes = $this->scopeRepository->finalizeScopes($scopes, $this->getIdentifier(), $client, $oldRefreshToken['user_id'] ?? null); // Expire old tokens $this->accessTokenRepository->revokeAccessToken($oldRefreshToken['access_token_id']); diff --git a/tests/Grant/RefreshTokenGrantTest.php b/tests/Grant/RefreshTokenGrantTest.php index b37001a80..82528c42a 100644 --- a/tests/Grant/RefreshTokenGrantTest.php +++ b/tests/Grant/RefreshTokenGrantTest.php @@ -564,7 +564,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); $accessTokenRepositoryMock