Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct issue with GoogleProvider getUserByToken() method #689

Merged
merged 2 commits into from
Feb 11, 2024

Conversation

alibori
Copy link
Contributor

@alibori alibori commented Feb 10, 2024

Calling getUserByToken from GoogleProvider crashes with:

TypeError error json_decode(): Argument #1 ($json) must be of type string, GuzzleHttp\Psr7\Stream given.

To handle this situation, added this code in getUserByToken method:

  if ($response->getBody() instanceof Stream) {
      return json_decode($response->getBody()->getContents(), true);
  }

Finally, test added to check method works as expected.

@driesvints driesvints linked an issue Feb 10, 2024 that may be closed by this pull request
Copy link
Contributor

@iBotPeaches iBotPeaches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this is happening - wouldn't this affect all providers? What makes the Google one special?

Just saying this as I just pulled dev-master to get the last merged PR to test my fixes and I've never once replicated this error. Can't figure out what I'm missing.

@taylorotwell
Copy link
Member

Needs reproduction example.

@taylorotwell taylorotwell merged commit ffeeb2c into laravel:5.x Feb 11, 2024
22 checks passed
@alibori
Copy link
Contributor Author

alibori commented Feb 12, 2024

Hi!

Which is the best way to share a reproduction example? Sharing the composer.json file with fixed versions?

Thanks!

@driesvints
Copy link
Member

@alibori no worries we merged this one 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GoogleProvider Type Error
5 participants