@@ -2,8 +2,6 @@ import axios from 'axios' import * as https from 'https' import { getSession, signOut } from 'next-auth/react' -const BLACKLISTED_TOKEN_MESSAGE = 'Токен занесен в черный список' - export function setupAxios() { axios.defaults.httpsAgent = new https.Agent({ rejectUnauthorized: false, @@ -35,7 +33,7 @@ export function setupAxios() { (response) => response, (error) => { if (!error.response && typeof window !== 'undefined') { - window.location.href = '/network-error' + return error } if (error?.response?.status === 401 || error?.status === 401) { @@ -16,9 +16,6 @@ api.interceptors.request.use((config) => { api.interceptors.response.use( (response) => response, (error) => { - if (!error.response && typeof window !== 'undefined') { - window.location.href = '/network-error' - } return error } )