Skip to content

Commit

Permalink
добавил в проверку статуса 401 ответ
Browse files Browse the repository at this point in the history
  • Loading branch information
epavlyuchenkov committed Sep 3, 2024
1 parent 23b74cd commit d1167bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/AmoCRM/OAuth/AmoCRMOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ public function getAccessTokenByRefreshToken(AccessTokenInterface $accessToken):
'refresh_token' => $accessToken->getRefreshToken(),
]);
} catch (IdentityProviderException $e) {
if ($e->getCode() === StatusCodeInterface::STATUS_NOT_FOUND) {
if (in_array(
$e->getCode(), [StatusCodeInterface::STATUS_NOT_FOUND, StatusCodeInterface::STATUS_UNAUTHORIZED], true
)) {
$accountDomainModel = $this->getAccountDomainByRefreshToken($accessToken);
$this->setBaseDomain($accountDomainModel->getDomain());

Expand Down

0 comments on commit d1167bc

Please sign in to comment.