From 9cc3dcacac7fc1463dd950db753485409f55dec1 Mon Sep 17 00:00:00 2001 From: Itamar Gafni Date: Thu, 8 Aug 2024 12:17:21 +0300 Subject: [PATCH] fix(offline-scans): If HTTP status is 'unauthorized' always try to refresh token and try again one more time --- intezer_sdk/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intezer_sdk/api.py b/intezer_sdk/api.py index b41087f..c269a30 100644 --- a/intezer_sdk/api.py +++ b/intezer_sdk/api.py @@ -163,7 +163,7 @@ def request_with_refresh_expired_access_token(self, self._refresh_token_if_needed() response = self._request(method, path, data, headers, files, stream, base_url, timeout_in_seconds) - if response.status_code == HTTPStatus.UNAUTHORIZED and not self._token_expiration: + if response.status_code == HTTPStatus.UNAUTHORIZED: self._set_access_token() response = self._request(method, path, data, headers, files, stream, base_url, timeout_in_seconds)