From 3f04e318d1de9e192e6f9a6e7d9cd99ca1ce43d2 Mon Sep 17 00:00:00 2001 From: Seok93 Date: Thu, 28 Nov 2024 13:01:58 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Fix:=20#275=20=EB=A1=9C=EA=B7=B8=EC=95=84?= =?UTF-8?q?=EC=9B=83=EC=8B=9C=20Access=20Token=EC=9D=B4=20=ED=8F=AC?= =?UTF-8?q?=ED=95=A8=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/authService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/authService.ts b/src/services/authService.ts index b03368db..1b57510d 100644 --- a/src/services/authService.ts +++ b/src/services/authService.ts @@ -101,7 +101,7 @@ export async function getUserInfo(axiosConfig: AxiosRequestConfig = {}) { * @returns {Promise>} */ export async function logout(axiosConfig: AxiosRequestConfig = {}) { - return defaultAxios.post('user/logout', null, { ...axiosConfig, withCredentials: true }); + return authAxios.post('user/logout', null, { ...axiosConfig, withCredentials: true }); } /** From 3f39956ecb20c64bdb500db5f478e9e6bf351ded Mon Sep 17 00:00:00 2001 From: Seok93 Date: Thu, 28 Nov 2024 13:14:06 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Fix:=20#275=20MSW=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EC=B2=98=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/services/authServiceHandler.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mocks/services/authServiceHandler.ts b/src/mocks/services/authServiceHandler.ts index fa6ac869..4096e34f 100644 --- a/src/mocks/services/authServiceHandler.ts +++ b/src/mocks/services/authServiceHandler.ts @@ -258,8 +258,13 @@ const authServiceHandler = [ }), // ๋กœ๊ทธ์•„์›ƒ API - http.post(`${API_URL}/user/logout`, async ({ cookies }) => { + http.post(`${API_URL}/user/logout`, async ({ request, cookies }) => { + const accessToken = request.headers.get('Authorization'); const { refreshToken } = cookies; + + if (!accessToken) return new HttpResponse(null, { status: 401 }); + if (!refreshToken) return new HttpResponse(null, { status: 400 }); + const currentTime = Date.now(); return new HttpResponse(null, {