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

Set approvedScopes attribute as in Socialite #224

Open
omarcinkonis opened this issue Oct 17, 2023 · 1 comment
Open

Set approvedScopes attribute as in Socialite #224

omarcinkonis opened this issue Oct 17, 2023 · 1 comment

Comments

@omarcinkonis
Copy link

omarcinkonis commented Oct 17, 2023

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:

  1. Use any provider from socialiteproviders
  2. Authorize a social network
  3. Call user() and check approvedScopes attribute
  4. approvedScopes will be null

Proposed solution:

Include the code from Socialite user() method:

->setApprovedScopes(explode($this->scopeSeparator, Arr::get($response, 'scope', '')));
@omarcinkonis omarcinkonis changed the title Set approvedScopes attribute as in Laravel source Set approvedScopes attribute as in Socialite Jan 24, 2024
@atymic
Copy link
Member

atymic commented May 4, 2024

Closed in #229

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 a pull request may close this issue.

2 participants