Skip to content

Commit 4359d99

Browse files
committed
refactor: replace safeSessionStorage with safeLocalStorage in axios client and redirect logic
1 parent 8f25538 commit 4359d99

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

apps/ticket-admin/src/lib/axios/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { EXTERNAL_PATH } from "@/shared/constants/path";
44
import { IS_LOGINED } from "@/shared/constants/storage";
55
import { isAxiosErrorResponse } from "@/shared/types/axioxError";
66

7-
import { safeSessionStorage } from "../storage";
7+
import { safeLocalStorage } from "../storage";
88
import { ERROR_CODE } from "./utils/errorCode";
99

1010
export const instance = axios.create({
@@ -152,7 +152,7 @@ function redirectToLoginOnce() {
152152
isLoginAlertShown = true;
153153

154154
alert("로그인이 필요한 페이지입니다.");
155-
safeSessionStorage.remove(IS_LOGINED);
155+
safeLocalStorage.remove(IS_LOGINED);
156156

157157
const redirectUrl = `${EXTERNAL_PATH.LOGIN}?redirectUrl=${encodeURIComponent(
158158
window.location.origin + window.location.pathname + window.location.search,

apps/ticket/src/lib/axios/clientAxios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { PATH } from "@/shared/constants/path";
44
import { IS_LOGINED } from "@/shared/constants/storage";
55
import { AxiosErrorResponse, isAxiosErrorResponse } from "@/shared/types/axioxError";
66

7-
import { safeSessionStorage } from "../storage";
7+
import { safeLocalStorage } from "../storage";
88
import { ERROR_CODE } from "./utils/errorCode";
99

1010
export const clientAxios = axios.create({
@@ -87,7 +87,7 @@ function redirectToLoginOnce() {
8787
isLoginAlertShown = true;
8888

8989
alert("로그인 후 이용해 주세요.");
90-
safeSessionStorage.remove(IS_LOGINED);
90+
safeLocalStorage.remove(IS_LOGINED);
9191

9292
const redirectUrl = window.location.pathname + window.location.search;
9393

apps/ticket/src/shared/helpers/redirectToLoginOnce.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { safeSessionStorage } from "@/lib/storage";
1+
import { safeLocalStorage } from "@/lib/storage";
22
import { PATH } from "@/shared/constants/path";
33
import { IS_LOGINED } from "@/shared/constants/storage";
44

@@ -13,7 +13,7 @@ export function redirectToLoginOnce() {
1313
isLoginAlertShown = true;
1414

1515
alert("로그인 후 이용해 주세요.");
16-
safeSessionStorage.remove(IS_LOGINED);
16+
safeLocalStorage.remove(IS_LOGINED);
1717

1818
const redirectUrl = window.location.pathname + window.location.search;
1919
const loginUrl = `${PATH.LOGIN}?redirectUrl=${encodeURIComponent(redirectUrl)}`;

0 commit comments

Comments
 (0)