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 #700

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

ChengKaiChiang
Copy link
Contributor

Calling getUserByToken twice from GoogleProvider will result in obtaining null value for the second call. If you directly use getContents() from GuzzleHttp\Psr7\Stream to retrieve values, after the first retrieval, you need to execute seek(0) to reset the pointer position to the beginning. This is necessary for the second retrieval to work properly. __toString() handles this internally.

Scenario :
When using the GuzzleHttp\Client class, I've implemented a LogMiddleware. This middleware is primarily for logging the request body and response body of each API call. Consequently, during logging, getContents is executed once, leading to getContents during the return of getUserByToken actually receiving null.

@taylorotwell taylorotwell merged commit feed1c1 into laravel:5.x Apr 24, 2024
20 checks passed
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.

2 participants