Manager
Manager copied to clipboard
Set approvedScopes attribute as in Socialite
Issue / Motivation:
socialite/src/Two/AbstractProvider.php:261 sets approvedScopes attribute:
->setApprovedScopes(explode($this->scopeSeparator, Arr::get($response, 'scope', '')));
In SocialiteProviders/Manager, the attribute is not set. It is always null.
Expected behavior:
socialiteproviders/manager/src/OAuth2/AbstractProvider.php user() method should set approvedScopes, as in Socialite.
Actual behavior:
approvedScopes attribute is not set, the attribute is always null. Users of the package must manually extract approved scopes from response, if scopes are needed.
Steps to reproduce the behavior:
- Use any provider from socialiteproviders
- Authorize a social network
- Call user() and check approvedScopes attribute
- approvedScopes will be null
Proposed solution:
Include the code from Socialite user() method:
->setApprovedScopes(explode($this->scopeSeparator, Arr::get($response, 'scope', '')));
Closed in #229