Skip to content

Commit

Permalink
Fix/#32: 토큰 갱신 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
imddoy committed Jan 13, 2025
1 parent c62f912 commit 0286276
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class ApiError extends Error {
}

// accessToken 가져오기
const cachedToken: string | null = null;
let cachedToken: string | null = null;

const getAccessToken = (): string | null => {
if (!cachedToken) {
Expand All @@ -23,7 +23,7 @@ const getAccessToken = (): string | null => {
if (user) {
try {
const userObj = JSON.parse(user);
return userObj.accessToken || null;
cachedToken = userObj.accessToken || null;
} catch (error) {
console.error('유저의 토큰 정보를 가져올 수 없습니다', error);
return null;
Expand Down

0 comments on commit 0286276

Please sign in to comment.