Skip to content

Commit

Permalink
Merge pull request #204 from SystemConsultantGroup/hotfix/send-null-w…
Browse files Browse the repository at this point in the history
…hen-no-access-token

fix: accessToken 이 없는 경우 undefined 대신 null 을 보내어 에러를 해결한다
  • Loading branch information
shj1081 authored Feb 9, 2025
2 parents 7f93ff0 + 7853753 commit 9e0de4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/fetcher/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ const getIsomorphicToken = async () => {
if (typeof window !== "undefined") {
// 브라우저 환경
const accessToken = Cookies.get(JWT_COOKIE_NAME);
return { accessToken };
return { accessToken: accessToken ?? null };
} else {
// 서버 환경
// getServerSideToken 내부의 next/headers 에서 가져오는 cookies 가
// 클라이언트 프로덕션 환경에서는 문제를 일으켜서 우선 임시로 이렇게 해결
const { accessToken } = await getServerSideToken();
return { accessToken };
return { accessToken: accessToken ?? null };
}
};

0 comments on commit 9e0de4d

Please sign in to comment.