Skip to content

Commit

Permalink
fix: refresh 토큰 재발급 api 주소 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
asaei623 committed Sep 25, 2023
1 parent 37e996c commit a8d55ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/network/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ publicInstance.interceptors.response.use(
// access token이 만료되었고 refresh token이 있는 경우
try {
// 새로운 access token을 받아온 뒤 저장
const response = await publicInstance.post('/refreshToken', {
refreshToken,
const response = await axios.get(`${BASE_URL}/login/token/refresh`, {
headers: {
Authorization: refreshToken,
},
});
const newAccessToken = response.data.accessToken;
const newAccessToken = response.data.result.access_token;
setAccessToken(newAccessToken);

// 이전 요청을 재시도
publicInstance.defaults.headers.common['Authorization'] =
newAccessToken;
return publicInstance(originalRequest);
} catch (err) {
// refresh token이 유효하지 않은 경우
Expand Down

0 comments on commit a8d55ca

Please sign in to comment.