Skip to content

Set approvedScopes attribute as in Socialite #224

Closed as not planned
Closed as not planned
@omarcinkonis

Description

@omarcinkonis

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', '')));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions