Skip to content

Commit

Permalink
fix: accessToken 이 없는 경우 undefined 대신 null 을 보내어 에러를 해결한다
Browse files Browse the repository at this point in the history
  • Loading branch information
jaychang99 committed Feb 9, 2025
1 parent 7f93ff0 commit 7853753
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 7853753

Please sign in to comment.