Skip to content

Commit

Permalink
fix(google provider): check if response body of GoogleProvider's getU…
Browse files Browse the repository at this point in the history
…serByToken method is a GuzzleHttp\Psr7\Stream instance
  • Loading branch information
aliboriwwwarcelona committed Feb 9, 2024
1 parent d2a8113 commit 1e0324a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Two/GoogleProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Laravel\Socialite\Two;

use GuzzleHttp\Psr7\Stream;
use GuzzleHttp\RequestOptions;
use Illuminate\Support\Arr;

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 1e0324a

Please sign in to comment.