diff --git a/src/ApiRequest.php b/src/ApiRequest.php index 45eb8c6..ca4a3ce 100644 --- a/src/ApiRequest.php +++ b/src/ApiRequest.php @@ -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();