refresh-token의 도메인 설정

This commit is contained in:
2026-10-28 16:24:48 +09:00
parent ee0049722f
commit a4412001b3
3 changed files with 24 additions and 25 deletions
+5 -9
View File
@@ -122,12 +122,8 @@ export async function PUT(
}
function getCookieDomain(): string | undefined {
if (typeof window === "undefined") return undefined;
if (COOKIE_DOMAIN) return COOKIE_DOMAIN;
const { hostname } = window.location;
if (hostname === "localhost" || hostname === "127.0.0.1") return undefined;
return hostname;
}
// 개발에서는 현재 사이트 전용, 운영에서는 환경변수의 공용 도메인을 사용한다.
return process.env.NODE_ENV === "production"
? COOKIE_DOMAIN || undefined
: undefined;
}