Skip to content

Commit

Permalink
feat: refreshToken api 요청시 헤더에 content-type 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jiwonh423 committed Sep 19, 2023
1 parent c5df478 commit 681ab38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/apis/getApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ async function withTokenRefresh<T>(callback: () => Promise<T>): Promise<T> {
if (decodedPayloadObject.exp * 1000 < Date.now()) {
console.log('AccessToken 만료되어 재요청합니다');

const headers: any = { Authorization: `Bearer ${userToken}` };
const headers: any = {
'content-type': 'application/json',
Authorization: `Bearer ${userToken}`,
};
console.log(`Authorization : Bearer ${userToken}`);
//새로운 토큰 재발급
userToken = await refreshToken(headers);
Expand Down

0 comments on commit 681ab38

Please sign in to comment.