diff --git a/Coding/src/Provider.php b/Coding/src/Provider.php index d43cf47..0427b70 100644 --- a/Coding/src/Provider.php +++ b/Coding/src/Provider.php @@ -18,25 +18,13 @@ class Provider extends AbstractProvider */ protected $scopes = ['user']; - private $openId; - /** * {@inheritdoc} */ protected function getAuthUrl($state) { + // HACK: CODING 每个注册团队都是单独的二级域名,需要传递进来,目前发现有 with 和 guzzle 两种方法可以实现,这里选择 guzzle。 return $this->buildAuthUrlFromBase($this->guzzle['base_uri'] . 'oauth_authorize.html', $state); - return $this->buildAuthUrlFromBase($this->getTeamUrl() . 'oauth_authorize.html', $state); - } - - /** - * {@inheritdoc} - */ - protected function getTeamUrl() - { - // HACK: CODING 每个注册团队都是单独的二级域名,需要传递进来,目前发现有 with 和 guzzle 两种方法可以实现。 - $team = Arr::pull($this->parameters, 'team'); - return "https://{$team}.coding.net/"; } /** @@ -45,8 +33,6 @@ protected function getTeamUrl() protected function getTokenUrl() { return '/api/oauth/access_token'; - $team = Arr::pull($this->parameters, 'team'); - return $this->getTeamUrl() . 'api/oauth/access_token'; } /** @@ -68,7 +54,6 @@ protected function getUserByToken($token) */ protected function mapUserToObject(array $user) { - \Log::error(__METHOD__, $user); return (new User())->setRaw($user)->map([ 'id' => $user['id'], 'nickname' => null,