Skip to content

Commit

Permalink
Support 401 responses
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed May 28, 2021
1 parent a9862d8 commit 10cfae4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ApiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ function () {
return $this->_getRawResult();
},
function (Exception $e) {
if($e->getCode() == 403 && stristr($e->getMessage(), 'token'))
$reset = $e->getCode() == 401;
$reset = $reset || $e->getCode() == 403 && stristr($e->getMessage(), 'token');
if($reset)
{
$this->_connection->clearToken();
$this->_endpoint->clearToken();
Expand Down

0 comments on commit 10cfae4

Please sign in to comment.