Skip to content

Commit

Permalink
Merge pull request #154 from dnd-side-project/fix-153
Browse files Browse the repository at this point in the history
[# 153] 로그인 직후 요청에 헤더 포함 안되는 문제 수정
  • Loading branch information
gihwan-dev authored Aug 30, 2024
2 parents 258b41f + 36032eb commit ac8457a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libs/baseAxios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export const baseAxios = axios.create({

export const privateAxios = axios.create({
baseURL: import.meta.env.VITE_API_URL,
headers: {
Authorization: `Bearer ${getCookie('access-token')}`,
},
});

privateAxios.interceptors.request.use((config) => {
config.headers.Authorization = `Bearer ${getCookie('access-token')}`;
return config;
});
2 changes: 2 additions & 0 deletions src/mocks/mockDatas/randomSigninData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export const randomSigninData = [
status: 'success',
accessToken: 'accessToken',
refreshToken: 'refreshToken',
expiresIn: 21599,
refreshTokenExpiresIn: 2159999,
},
{
status: 'pending',
Expand Down

0 comments on commit ac8457a

Please sign in to comment.