diff --git a/src/mocks/services/authServiceHandler.ts b/src/mocks/services/authServiceHandler.ts index fa6ac86..4096e34 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, { diff --git a/src/services/authService.ts b/src/services/authService.ts index b03368d..1b57510 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 }); } /**