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);