```js const responseInterceptor = (res) => { if (res.status === 401) { if (res.body.message.includes('jwt invalid')) { updateToken().then(() => { // send current request again }); } else { window.location.href = '/auth'; } } return res; }; ```