From 32db216d6a17731df5100aeaa002ec68e9524a79 Mon Sep 17 00:00:00 2001 From: "saito.k" Date: Wed, 20 Sep 2023 01:36:57 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20416:=20=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E6=99=82=E3=81=ABlogoutRedirect?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task1829: ログアウト時にlogoutRedirectを使うようにする](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1829) - タイトルの通り - 該当箇所をすべて修正 ## レビューポイント - 特になし ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 ## 動作確認状況 - ローカルで確認 ## 補足 - B2Cの設定も修正 - 不要なアクセストークンは発行しないように修正 --- dictation_client/src/App.tsx | 2 +- dictation_client/src/components/auth/routeAuthGuard.tsx | 2 +- dictation_client/src/pages/LicensePage/index.tsx | 2 +- dictation_client/src/pages/LoginPage/index.tsx | 2 +- dictation_client/src/pages/SamplePage/index.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dictation_client/src/App.tsx b/dictation_client/src/App.tsx index 676df3d..39bfec6 100644 --- a/dictation_client/src/App.tsx +++ b/dictation_client/src/App.tsx @@ -24,7 +24,7 @@ const App = (): JSX.Element => { (e: AxiosError) => { if (e?.response?.status === 401) { dispatch(clearToken()); - instance.logout({ + instance.logoutRedirect({ postLogoutRedirectUri: "/?logout=true", }); } diff --git a/dictation_client/src/components/auth/routeAuthGuard.tsx b/dictation_client/src/components/auth/routeAuthGuard.tsx index 7b4d9d0..37a14ac 100644 --- a/dictation_client/src/components/auth/routeAuthGuard.tsx +++ b/dictation_client/src/components/auth/routeAuthGuard.tsx @@ -23,7 +23,7 @@ export const RouteAuthGuard = (props: RouteAuthGuardProps) => { if (!isAuth || isExpired) { dispatch(clearToken()); // B2Cからもログアウトする - instance.logout({ + instance.logoutRedirect({ postLogoutRedirectUri: "/?logout=true", }); } diff --git a/dictation_client/src/pages/LicensePage/index.tsx b/dictation_client/src/pages/LicensePage/index.tsx index 26d2ab3..95f65f3 100644 --- a/dictation_client/src/pages/LicensePage/index.tsx +++ b/dictation_client/src/pages/LicensePage/index.tsx @@ -16,7 +16,7 @@ const LicensePage: React.FC = (): JSX.Element => { const redirectToTopPage = useCallback(() => { dispatch(clearToken()); - instance.logout({ + instance.logoutRedirect({ postLogoutRedirectUri: "/", }); }, [dispatch, instance]); diff --git a/dictation_client/src/pages/LoginPage/index.tsx b/dictation_client/src/pages/LoginPage/index.tsx index 002ee2f..ba7f6b0 100644 --- a/dictation_client/src/pages/LoginPage/index.tsx +++ b/dictation_client/src/pages/LoginPage/index.tsx @@ -25,7 +25,7 @@ const LoginPage: React.FC = (): JSX.Element => { // ログイン失敗した場合、B2Cをログアウトしてからエラーページに遷移する if (meta.requestStatus === "rejected") { - instance.logout({ + instance.logoutRedirect({ postLogoutRedirectUri: "/AuthError", }); } diff --git a/dictation_client/src/pages/SamplePage/index.tsx b/dictation_client/src/pages/SamplePage/index.tsx index 1d62cfa..ee3d56b 100644 --- a/dictation_client/src/pages/SamplePage/index.tsx +++ b/dictation_client/src/pages/SamplePage/index.tsx @@ -20,7 +20,7 @@ const SamplePage: React.FC = (): JSX.Element => { type="button" className={styles.buttonText} onClick={() => { - instance.logout({ postLogoutRedirectUri: "/" }); + instance.logoutRedirect({ postLogoutRedirectUri: "/" }); dispatch(clearToken()); }} >