Skip to content

Issue when retrying a call after a refresh #117

@jpvaillancourt

Description

@jpvaillancourt

I had an issue where the query params did not seems to be included into the GET request. I found out that, when the token was expired, a retry was done after a token refresh. Upon this retry, the $rawData variable was not passed to the call method.

In the file : /src/Client.php at line 200

} catch (ClientException $e) {
    // Retry?
    if ($e->getCode() === 401 && ! $this->retriedRefresh) {
        $this->oAuthClient->refreshAccessToken();
        $this->retriedRefresh = true;

        return $this->call($uri, $method, $data);
    }

    throw $e;
}

The fix is

} catch (ClientException $e) {
    // Retry?
    if ($e->getCode() === 401 && ! $this->retriedRefresh) {
        $this->oAuthClient->refreshAccessToken();
        $this->retriedRefresh = true;

        return $this->call($uri, $method, $data, $rawData);
    }

    throw $e;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions