diff --git a/src/Two/GoogleProvider.php b/src/Two/GoogleProvider.php index 9d822344..1bb553b7 100644 --- a/src/Two/GoogleProvider.php +++ b/src/Two/GoogleProvider.php @@ -2,6 +2,7 @@ namespace Laravel\Socialite\Two; +use GuzzleHttp\Psr7\Stream; use GuzzleHttp\RequestOptions; use Illuminate\Support\Arr; @@ -56,6 +57,10 @@ protected function getUserByToken($token) ], ]); + if ($response->getBody() instanceof Stream) { + return json_decode($response->getBody()->getContents(), true); + } + return json_decode($response->getBody(), true); }