Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when retrying a call after a refresh #117

Open
jpvaillancourt opened this issue Sep 16, 2024 · 0 comments
Open

Issue when retrying a call after a refresh #117

jpvaillancourt opened this issue Sep 16, 2024 · 0 comments

Comments

@jpvaillancourt
Copy link
Contributor

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;
}
jpvaillancourt added a commit to KORSR/ZohoBooksApi that referenced this issue Sep 16, 2024
jpvaillancourt added a commit to KORSR/ZohoBooksApi that referenced this issue Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant