From cafacb761d7e25d698058de4d68f7ca1349df698 Mon Sep 17 00:00:00 2001 From: "oura.a" Date: Fri, 13 Oct 2023 05:23:21 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20494:=20App.ts=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task2845: App.ts修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2845) App.tsxのエラーコード判定部分を修正しました。 ## レビューポイント なし ## UIの変更 なし ## 動作確認状況 ローカルでビルドエラーが出ないことを確認。 ローカルで無理やりエラーを投げ、以下を確認。 E010209を入れて401エラーを投げる  →ログアウトされない E010208を入れて401エラーを投げる  →ログアウトされる ## 補足 なし --- dictation_client/src/App.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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({