Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the scope param always going to be a string?
Do all providers return this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://datatracker.ietf.org/doc/html/rfc6749#section-3.3 proposed standard:
"scope" must be returned in response if the scopes granted don't match the scopes requested. Additional logic could be added to return requested scopes if "scope" is not set in response.
According to https://datatracker.ietf.org/doc/html/rfc6749#appendix-A.4 - "scope" should always be a string of this format:
scope-token *( SP scope-token )
Explanation:
scope-token
- at least one scope-token*( SP scope-token )
- optional 0 to many space delimited scope-tokensHowever, this RFC is only proposed, also "scope" is retrieved from json, decoded in vendor/laravel/socialite/src/Two/AbstractProvider.php:299, so there is a chance it won't be a string.
A more defensive approach should be probably be implemented. I'll look into it, maybe I'll open a PR to https://github.com/laravel/socialite/blob/5.x/src/Two/AbstractProvider.php#L261
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to accept this PR, if you add a condition to check if it's a string first?