diff --git a/dictation_client/src/App.tsx b/dictation_client/src/App.tsx index 4be155a..d9717a9 100644 --- a/dictation_client/src/App.tsx +++ b/dictation_client/src/App.tsx @@ -22,11 +22,11 @@ const App = (): JSX.Element => { useEffect(() => { const id = globalAxios.interceptors.response.use( (response: AxiosResponse) => response, - (e: AxiosError) => { + (e: AxiosError<{ code?: string }>) => { if ( e?.response?.status === 401 && - e.code && - !UNAUTHORIZED_TO_CONTINUE_ERROR_CODES.includes(e.code) + e?.response?.data?.code && + !UNAUTHORIZED_TO_CONTINUE_ERROR_CODES.includes(e.response.data.code) ) { dispatch(clearToken()); instance.logoutRedirect({