We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0037b24 commit cc3055bCopy full SHA for cc3055b
1 file changed
apps/ticket/src/lib/axios/index.ts
@@ -1,6 +1,7 @@
1
import axios, { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from "axios";
2
3
import { API_URL } from "@/data/constants";
4
+import { PATH } from "@/shared/constants/path";
5
import { IS_LOGINED } from "@/shared/constants/storage";
6
import { AxiosErrorResponse, isAxiosErrorResponse } from "@/shared/types/axioxError";
7
@@ -121,5 +122,10 @@ function redirectToLoginOnce() {
121
122
123
alert("로그인이 필요한 페이지입니다.");
124
safeLocalStorage.remove(IS_LOGINED);
- window.location.href = "/login";
125
+
126
+ const redirectUrl = window.location.pathname + window.location.search;
127
128
+ const loginUrl = `${PATH.LOGIN}?redirectUrl=${encodeURIComponent(redirectUrl)}`;
129
130
+ window.location.href = loginUrl;
131
}
0 commit comments