File tree Expand file tree Collapse file tree
apps/ticket/src/lib/axios Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+
615export 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}
Original file line number Diff line number Diff 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 } )
You can’t perform that action at this time.
0 commit comments