@@ -33,6 +33,8 @@ axios.defaults.validateStatus = () => true axios.interceptors.response.use(async (response) => { if (![401, 404, 403].includes(response.status)) return response + if (typeof window === 'undefined') return response + const session = await getSession() if (!session) { @@ -44,7 +46,7 @@ axios.interceptors.response.use(async (response) => { axios.interceptors.response.use( (response) => response, (error) => { - if (!error.response) { + if (!error.response && typeof window !== 'undefined') { window.location.href = '/network-error' } return error