Skip to content

Commit

Permalink
Fix Apple key retrieval when using Guzzle logging (#39)
Browse files Browse the repository at this point in the history
When using Guzzle logging to log a message body the stream is not reset to
the start, causing future calls to getContents() to be empty. It seems
recommended way of getting the body as a string is to use `__toString()`
(guzzle/guzzle#1842)
  • Loading branch information
pradtke committed Oct 1, 2022
1 parent d9d1797 commit 16c3708
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Provider/Apple.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private function getAppleKeys()
$response = $this->httpClient->request('GET', 'https://appleid.apple.com/auth/keys');

if ($response && $response->getStatusCode() === 200) {
return JWK::parseKeySet(json_decode($response->getBody()->getContents(), true));
return JWK::parseKeySet(json_decode($response->getBody()->__toString(), true));
}

return [];
Expand Down

0 comments on commit 16c3708

Please sign in to comment.