Skip to content

Commit 32ec762

Browse files
committed
fix(refresh): new instance로 변경해 무한요청 방지
1 parent bb18867 commit 32ec762

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/apis/token/refresh.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { TOKEN } from "@/constants/";
22
import Storage from "@/apis/storage";
3-
import httpClient from "../httpClient";
3+
import axios from "axios";
4+
5+
const instance = axios.create({
6+
baseURL: process.env.NEXT_PUBLIC_BASE_URL,
7+
});
48

59
const refresh = async () => {
610
try {
7-
const { data } = await httpClient.refresh.put({
11+
const { data } = await instance.put("/api/auth/refresh/access", {
812
refreshToken: `${Storage.getItem(TOKEN.REFRESH)}`,
913
});
1014
Storage.setItem(TOKEN.ACCESS, data.accessToken);

0 commit comments

Comments
 (0)