Skip to content

Commit

Permalink
- Fix retryWhenCallback issue of PendingRequest class that excluded P…
Browse files Browse the repository at this point in the history
…endingRequest on the parameter
  • Loading branch information
ianriizky committed May 6, 2022
1 parent 3cf6d3b commit f1305a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Services/Concerns/HandleAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ protected function getCredentials(): array
*/
protected function retryRequestWhenUnauthorized(): Closure
{
return function (Throwable $exception, PendingRequest $request) {
$request = $this->request;

return function (Throwable $exception) use ($request) {
if (! $exception instanceof RequestException || $exception->getCode() !== HttpResponse::HTTP_UNAUTHORIZED) {
return false;
}
Expand Down

0 comments on commit f1305a5

Please sign in to comment.