Skip to content

Commit

Permalink
[Slack] Remove Slack's default scopes to avoid conflicts (#53)
Browse files Browse the repository at this point in the history
* Remove Slack's default scopes to avoid conflicts

* Provide some default scopes for the Slack provider if the user didn't define some
  • Loading branch information
nesk authored and faustbrian committed Apr 4, 2017
1 parent 25a84fb commit 6e677a9
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,27 @@ class Provider extends AbstractProvider implements ProviderInterface
*/
const IDENTIFIER = 'SLACK';

/**
* {@inheritdoc}
*/
protected $scopes = ['identity.basic', 'identity.email', 'identity.team', 'identity.avatar'];

/**
* The separating character for the requested scopes.
*
* @var string
*/
protected $scopeSeparator = ',';

/**
* {@inheritdoc}
*/
public function getScopes()
{
if (count($this->scopes) > 0) {
return $this->scopes;
}

// Provide some default scopes if the user didn't define some.
// See: https://github.com/SocialiteProviders/Providers/pull/53
return ['identity.basic', 'identity.email', 'identity.team', 'identity.avatar'];
}

/**
* Middleware that throws exceptions for non successful slack api calls
* "http_error" request option is set to true.
Expand Down

0 comments on commit 6e677a9

Please sign in to comment.