Merged PR 416: ログアウト時にlogoutRedirectを使うようにする
## 概要 [Task1829: ログアウト時にlogoutRedirectを使うようにする](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1829) - タイトルの通り - 該当箇所をすべて修正 ## レビューポイント - 特になし ## UIの変更 - Before/Afterのスクショなど - スクショ置き場 ## 動作確認状況 - ローカルで確認 ## 補足 - B2Cの設定も修正 - 不要なアクセストークンは発行しないように修正
This commit is contained in:
parent
8fee108a78
commit
32db216d6a
@ -24,7 +24,7 @@ const App = (): JSX.Element => {
|
||||
(e: AxiosError) => {
|
||||
if (e?.response?.status === 401) {
|
||||
dispatch(clearToken());
|
||||
instance.logout({
|
||||
instance.logoutRedirect({
|
||||
postLogoutRedirectUri: "/?logout=true",
|
||||
});
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ export const RouteAuthGuard = (props: RouteAuthGuardProps) => {
|
||||
if (!isAuth || isExpired) {
|
||||
dispatch(clearToken());
|
||||
// B2Cからもログアウトする
|
||||
instance.logout({
|
||||
instance.logoutRedirect({
|
||||
postLogoutRedirectUri: "/?logout=true",
|
||||
});
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ const LicensePage: React.FC = (): JSX.Element => {
|
||||
|
||||
const redirectToTopPage = useCallback(() => {
|
||||
dispatch(clearToken());
|
||||
instance.logout({
|
||||
instance.logoutRedirect({
|
||||
postLogoutRedirectUri: "/",
|
||||
});
|
||||
}, [dispatch, instance]);
|
||||
|
||||
@ -25,7 +25,7 @@ const LoginPage: React.FC = (): JSX.Element => {
|
||||
|
||||
// ログイン失敗した場合、B2Cをログアウトしてからエラーページに遷移する
|
||||
if (meta.requestStatus === "rejected") {
|
||||
instance.logout({
|
||||
instance.logoutRedirect({
|
||||
postLogoutRedirectUri: "/AuthError",
|
||||
});
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ const SamplePage: React.FC = (): JSX.Element => {
|
||||
type="button"
|
||||
className={styles.buttonText}
|
||||
onClick={() => {
|
||||
instance.logout({ postLogoutRedirectUri: "/" });
|
||||
instance.logoutRedirect({ postLogoutRedirectUri: "/" });
|
||||
dispatch(clearToken());
|
||||
}}
|
||||
>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user