Overtrue\Socialite\Providers\QQProvider::getUserByToken PHP Method

getUserByToken() protected method

Get the raw user for the given access token.
protected getUserByToken ( Overtrue\Socialite\AccessTokenInterface $token ) : array
$token Overtrue\Socialite\AccessTokenInterface
return array
    protected function getUserByToken(AccessTokenInterface $token)
    {
        $url = $this->baseUrl . '/oauth2.0/me?access_token=' . $token->getToken();
        $this->withUnionId && ($url .= '&unionid=1');
        $response = $this->getHttpClient()->get($url);
        $me = json_decode($this->removeCallback($response->getBody()->getContents()), true);
        $this->openId = $me['openid'];
        $this->unionId = isset($me['unionid']) ? $me['unionid'] : '';
        $queries = ['access_token' => $token->getToken(), 'openid' => $this->openId, 'oauth_consumer_key' => $this->clientId];
        $response = $this->getHttpClient()->get($this->baseUrl . '/user/get_user_info?' . http_build_query($queries));
        return json_decode($this->removeCallback($response->getBody()->getContents()), true);
    }