Skip to content

Commit

Permalink
Merge pull request #87 from innovationacademy-kr/fe/dev/bug_accessToken/
Browse files Browse the repository at this point in the history
#86

[FE] BUG: 프로덕트 환경에서 로그아웃 시 토큰 삭제가 안되는 버그 #86
  • Loading branch information
42inshin authored Jan 8, 2024
2 parents 27736b7 + f62e403 commit 2dd6ab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/cookie/cookies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const tokenName = import.meta.env.VITE_TOKEN;
const domain = new URL(window.location.origin).hostname;

export const getCookie = () => {
return document.cookie
Expand All @@ -10,5 +11,5 @@ export const getCookie = () => {
};

export const removeCookie = (): void => {
document.cookie = `${tokenName}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
document.cookie = `${tokenName}=; path=/; domain=${domain}; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;
};

0 comments on commit 2dd6ab0

Please sign in to comment.