diff --git a/src/api/axios.ts b/src/api/axios.ts index 04ff80fd..efb4751c 100644 --- a/src/api/axios.ts +++ b/src/api/axios.ts @@ -34,8 +34,8 @@ instance.interceptors.response.use( }); if (tokenResponse.status === 200) { const { accessToken, refreshToken } = tokenResponse.data; - setCookie('accessToken', accessToken); - setCookie('refreshToken', refreshToken); + setCookie('accessToken', accessToken, { path: '/' }); + setCookie('refreshToken', refreshToken, { path: '/' }); axios.defaults.headers.common.Authorization = `${accessToken}`; originRequest.headers.Authorization = `${accessToken}`; return instance(originRequest); @@ -86,8 +86,8 @@ publicInstance.interceptors.response.use( }); if (tokenResponse.status === 200) { const { accessToken, refreshToken } = tokenResponse.data; - setCookie('accessToken', accessToken); - setCookie('refreshToken', refreshToken); + setCookie('accessToken', accessToken, { path: '/' }); + setCookie('refreshToken', refreshToken, { path: '/' }); axios.defaults.headers.common.Authorization = `${accessToken}`; originRequest.headers.Authorization = `${accessToken}`; return axios(originRequest);