@@ -14,6 +14,7 @@ export function setupAxios() { axios.interceptors.response.use(async (response) => { if (typeof window === 'undefined') return response + if (response.status === 401) { await signOut({ callbackUrl: '/login' }) return response @@ -36,6 +37,10 @@ export function setupAxios() { if (!error.response && typeof window !== 'undefined') { window.location.href = '/network-error' } + + if (error.response.status === 401) { + signOut({ callbackUrl: '/login' }) + } return error } )