Skip to content

Commit 535ad5a

Browse files
committed
fix: qa
1 parent 9e1d238 commit 535ad5a

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
import { API_URL } from "@/data/constants";
1+
import axios from "axios";
22

3-
import { instance } from "..";
3+
import { API_URL } from "@/data/constants";
44

55
// 엑세스 토큰 재발급 함수
6+
const refreshClient = axios.create({
7+
baseURL: process.env.NEXT_PUBLIC_TICKET_API_BASE_URL,
8+
timeout: 10_000,
9+
headers: {
10+
"Content-Type": "application/json",
11+
},
12+
withCredentials: true,
13+
});
14+
615
export async function refreshAccessToken() {
7-
const { data } = await instance.post(API_URL.USER.REISSUE_ACCESS_TOKEN);
16+
const { data } = await refreshClient.post(API_URL.USER.REISSUE_ACCESS_TOKEN);
817

918
return data;
1019
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ instance.interceptors.response.use(
7777
await tokenRefreshPromise;
7878
} else {
7979
// 토큰 재발급 시작
80-
refreshAccessToken()
80+
tokenRefreshPromise = refreshAccessToken()
8181
.then(() => {
8282
tokenRefreshPromise = null;
8383
})

0 commit comments

Comments
 (0)