Skip to content

Commit

Permalink
Fix: 인증 헤더를 인터셉터단에서 구성하도록 롤백
Browse files Browse the repository at this point in the history
  • Loading branch information
sscoderati committed Jan 16, 2024
1 parent ac74e48 commit adafe80
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/apis/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@ export const axiosAPI = axios.create({
process.env.NODE_ENV === "development"
? "http://localhost:5173"
: import.meta.env.VITE_BASE_URL,
headers: {
Authorization: `${tokens?.accessToken}`,
},
// headers: {
// Authorization: `${tokens?.accessToken}`,
// },
});

axiosAPI.interceptors.request.use(
(config) => {
config.headers.Authorization = `${tokens?.accessToken}`;
return config;
},
(error) => {
return Promise.reject(error);
},
);

// TODO: axiosAPI.interceptors.response.use()를 사용하여 refreshToken이 만료되었을 때, accessToken을 재발급 받는 로직을 구현해야 합니다.

0 comments on commit adafe80

Please sign in to comment.