From 77e75c989dccaea30fe297818afa08445bbd2fdc Mon Sep 17 00:00:00 2001 From: seohee0112 Date: Thu, 21 Jul 2022 17:25:36 +0900 Subject: [PATCH] =?UTF-8?q?[=20fix=20]=20axios=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/axios.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/axios.ts b/core/axios.ts index 562175f..f0e782e 100644 --- a/core/axios.ts +++ b/core/axios.ts @@ -12,10 +12,8 @@ const baseInstance = axios.create({ baseInstance.interceptors.request.use((config) => { const headers = { ...config.headers, - accessToken: - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MzAsImlhdCI6MTY1ODM4NDEwMCwiZXhwIjoxNjU4MzkxMzAwLCJpc3MiOiJub3JpIn0.ZNRxtGPFJpVCHJzlK0HdcgPcZWvkkCt3FZ_VHu8sz7M', - refreshToken: - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MzAsImlhdCI6MTY1ODM4NDEwMCwiZXhwIjoxNjU5NTkzNzAwLCJpc3MiOiJub3JpIn0.AeuhSmM1ZqItojeM3O0SwrELog-Qfq91r_ii0EMgPig', + accessToken: LocalStorage.getItem('accessToken'), + refreshToken: LocalStorage.getItem('refreshToken'), }; return { ...config, headers }; @@ -37,7 +35,7 @@ baseInstance.interceptors.response.use( if (status === 401) { // token refresh 요청 const { data } = await axios.post( - `/auth/refresh`, // token refresh api + `/auth/token/refresh`, // token refresh api {}, { headers: {