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:
parent
370d143c2c
commit
cafacb761d
@ -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({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user