Skip to content

Commit e2eb9ba

Browse files
committed
Prevent recursion in the connection repository by only trying to re-fetch the token once after an implicit reauthentication
1 parent 81bdc93 commit e2eb9ba

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Authentication/StorageBackedConnectionRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function findTokenForConnection(Connection $connection): TokenInterface
8686
// Generally this would mean the token expired from storage, attempt to re-authenticate the connection
8787
$this->authenticator->authenticate($connection);
8888

89-
return $this->findTokenForConnection($connection);
89+
return $this->tokenStorage->getToken($storageId);
9090
}
9191
}
9292

tests/Authentication/StorageBackedConnectionRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function testFindTokenForConnectionAfterReauthenticating(): void
6666
/** @var MockObject&TokenInterface $token */
6767
$token = $this->createMock(TokenInterface::class);
6868

69-
$this->tokenStorage->expects(self::exactly(2))
69+
$this->tokenStorage->expects(self::once())
7070
->method('generateStorageId')
7171
->with($connection)
7272
->willReturn((string) $storageId);

0 commit comments

Comments
 (0)