Merged PR 494: App.ts修正

## 概要
[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エラーを投げる
 →ログアウトされる

## 補足
なし
This commit is contained in:
oura.a 2023-10-13 05:23:21 +00:00
parent 370d143c2c
commit cafacb761d

View File

@ -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({