From ca94ece2b38f048afe99a5ce3049bdcc76ac097e Mon Sep 17 00:00:00 2001 From: vigdorov Date: Tue, 4 Aug 2020 22:54:00 +0300 Subject: [PATCH] =?UTF-8?q?HM-86.=20=D0=92=D0=BA=D0=BB=D1=8E=D1=87=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0?= =?UTF-8?q?=20=D1=82=D0=BE=D0=BA=D0=B5=D0=BD=D0=BE=D0=B2=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20api,=20=D1=84=D0=B8=D0=BA=D1=81=20=D1=84=D1=80=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/HttpAuthAPI.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/api/HttpAuthAPI.js b/src/api/HttpAuthAPI.js index e2aa47f..7c05c8c 100644 --- a/src/api/HttpAuthAPI.js +++ b/src/api/HttpAuthAPI.js @@ -66,17 +66,15 @@ class HttpAuthApi { errorHandling = (error, resolve, reject, requestConfig) => { if (error.response.status === 401) { this.isPendingRefresh = true; - this.pendingRequests({resolve, reject, requestConfig}); + this.pendingRequests.push({resolve, reject, requestConfig}); authServiceApi.refresh() .then(() => { this.repeatRequests(); }) .catch((refreshError) => { this.rejectRequests(refreshError); - /* - * Снять авторизацию и сделать роут - * Сбросить все запросы с ошибкой авторизации - */ + tokenApi.clearTokents(); + location.reload(); }); } else { reject(error);