src/authclient/WeChat.php
public function refreshAccessToken(OAuthToken $token)
    {
        $params = [
            'grant_type' => 'refresh_token'
        ];
        $params = array_merge($token->getParams(), $params);

        $request = $this->createRequest()
            ->setMethod('POST')
            ->setUrl($this->refreshTokenUrl)
            ->setData($params);

        $this->applyClientCredentialsToRequest($request);

        $response = $this->sendRequest($request);

        $token = $this->createToken(['params' => $response]);
        $this->setAccessToken($token);

        return $token;
    }
public function refreshAccessToken(OAuthToken $token)
    {
        $params = [
            'grant_type' => 'refresh_token'
        ];
        $params = array_merge($token->getParams(), $params);

        $request = $this->createRequest()
            ->setMethod('POST')
            ->setUrl($this->refreshTokenUrl)
            ->setData($params);

        $this->applyClientCredentialsToRequest($request);

        $response = $this->sendRequest($request);

        $token = $this->createToken(['params' => $response]);
        $this->setAccessToken($token);

        return $token;
    }
public function refreshAccessToken ( OAuthToken $ token ) { $ params = [ 'grant_type' => 'refresh_token' ] ; $ params = array_merge ( $ token -> getParams ( ) , $ params ) ; $ request = $ this -> createRequest ( ) -> setMethod ( 'POST' ) -> setUrl ( $ this -> refreshTokenUrl ) -> setData ( $ params ) ; $ this -> applyClientCredentialsToRequest ( $ request ) ; $ response = $ this -> sendRequest ( $ request ) ; $ token = $ this -> createToken ( [ 'params' => $ response ] ) ; $ this -> setAccessToken ( $ token ) ; return $ token ; }
Gets new auth token to replace expired one.
@param OAuthToken $token expired auth token.
@return OAuthToken new auth token.
@throws \yii\authclient\InvalidResponseException
Gets new auth token to replace expired one .