Skip to content

Commit 753de15

Browse files
committed
fix: [FN-244] refresh요청의 경우에도 401에러 발생시 요청 재시도 하지 않도록 수정
1 parent 2745aef commit 753de15

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/shared/apis/fetch.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import useAuthStore from "@/stores/useAuthStore";
22
import axios from "axios";
33

44
const apiClient = axios.create({
5-
// baseURL: import.meta.env.DEV ? "/api" : import.meta.env.VITE_BASE_URL,
6-
baseURL: import.meta.env.VITE_BASE_URL,
5+
baseURL: import.meta.env.DEV ? "/api" : import.meta.env.VITE_BASE_URL,
6+
// baseURL: import.meta.env.VITE_BASE_URL,
77
timeout: 10000,
88
withCredentials: true,
99
headers: {
@@ -20,7 +20,12 @@ apiClient.interceptors.response.use(
2020
const originalRequest = error.config;
2121

2222
// refresh를 시도하지 않아야 하는 URL 목록
23-
const skipRefreshUrls = ["/auth/login", "/auth/register", "/auth/logout"];
23+
const skipRefreshUrls = [
24+
"/auth/login",
25+
"/auth/register",
26+
"/auth/logout",
27+
"/auth/refresh",
28+
];
2429
const shouldSkipRefresh = skipRefreshUrls.some((url) =>
2530
originalRequest.url?.includes(url)
2631
);

0 commit comments

Comments
 (0)