diff --git a/apps/fo/app/api/proxy/[...url]/route.ts b/apps/fo/app/api/proxy/[...url]/route.ts index 39f4281e3..17aecff95 100644 --- a/apps/fo/app/api/proxy/[...url]/route.ts +++ b/apps/fo/app/api/proxy/[...url]/route.ts @@ -1,3 +1,14 @@ +/** + * πŸ“„ Proxy Route + * API ν”„λ‘μ‹œ 라우트 + * + * - μ„œλ²„ API둜의 μš”μ²­ ν”„λ‘μ‹œ 처리 + * - μΏ ν‚€ 기반 인증 토큰 및 λ¦¬ν”„λ ˆμ‹œ 토큰 관리 + * - POST 및 PUT μš”μ²­ 핸듀링 + * - μ‚¬μš©μž 인증 정보 검증 및 응닡 처리 + * - μ—λŸ¬ 핸듀링 및 μƒνƒœ μ½”λ“œ λ°˜ν™˜ + * - μ‚¬μ΄νŠΈ ID 및 헀더 μ„€μ • + */ import { ACCESS_TOKEN, AUTH_USER_ID, @@ -113,12 +124,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; } diff --git a/apps/sn/app/api/proxy/[...url]/route.ts b/apps/sn/app/api/proxy/[...url]/route.ts index 999f54439..0ac10069f 100644 --- a/apps/sn/app/api/proxy/[...url]/route.ts +++ b/apps/sn/app/api/proxy/[...url]/route.ts @@ -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; -} \ No newline at end of file + // κ°œλ°œμ—μ„œλŠ” ν˜„μž¬ μ‚¬μ΄νŠΈ μ „μš©, μš΄μ˜μ—μ„œλŠ” ν™˜κ²½λ³€μˆ˜μ˜ 곡용 도메인을 μ‚¬μš©ν•œλ‹€. + return process.env.NODE_ENV === "production" + ? COOKIE_DOMAIN || undefined + : undefined; +} diff --git a/apps/wr/app/api/proxy/[...url]/route.ts b/apps/wr/app/api/proxy/[...url]/route.ts index 36c611459..b223c2560 100644 --- a/apps/wr/app/api/proxy/[...url]/route.ts +++ b/apps/wr/app/api/proxy/[...url]/route.ts @@ -113,12 +113,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; } \ No newline at end of file