Skip to content

Commit

Permalink
WeChat user() bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Feb 22, 2016
1 parent f854e86 commit 58a7d8c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Providers/WeChatProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 58a7d8c

Please sign in to comment.