diff --git a/src/Providers/WeChatProvider.php b/src/Providers/WeChatProvider.php index e6bec6a..d63e867 100644 --- a/src/Providers/WeChatProvider.php +++ b/src/Providers/WeChatProvider.php @@ -93,6 +93,12 @@ protected function getTokenUrl() */ protected function getUserByToken(AccessTokenInterface $token) { + $scopes = explode(',', $token->getAttribute('scope', '')); + + if (in_array('snsapi_base', $scopes)) { + return $token->toArray(); + } + $response = $this->getHttpClient()->get($this->baseUrl.'/userinfo', [ 'query' => [ 'access_token' => $token->getToken(),