diff --git a/src/lib/api/auth-fetch.ts b/src/lib/api/auth-fetch.ts index 766e511..53b1cfb 100644 --- a/src/lib/api/auth-fetch.ts +++ b/src/lib/api/auth-fetch.ts @@ -7,10 +7,9 @@ import { refreshSession } from './client' import type { AuthSession } from './types' +/** Client: relative URLs (empty string). Server: internal Docker network URL. */ const API_URL = - typeof window !== 'undefined' - ? (process.env.NEXT_PUBLIC_API_URL ?? '') - : (process.env.API_INTERNAL_URL ?? 'http://localhost:3000') + typeof window === 'undefined' ? (process.env.API_INTERNAL_URL ?? 'http://localhost:3000') : '' interface AuthFetchOptions { method?: 'GET' | 'POST' | 'PUT' | 'DELETE' diff --git a/src/lib/api/client.ts b/src/lib/api/client.ts index 112a8fd..48f2ac6 100644 --- a/src/lib/api/client.ts +++ b/src/lib/api/client.ts @@ -60,10 +60,9 @@ import type { BehavioralFlag, } from './types' +/** Client: relative URLs (empty string). Server: internal Docker network URL. */ const API_URL = - typeof window !== 'undefined' - ? (process.env.NEXT_PUBLIC_API_URL ?? '') - : (process.env.API_INTERNAL_URL ?? 'http://localhost:3000') + typeof window === 'undefined' ? (process.env.API_INTERNAL_URL ?? 'http://localhost:3000') : '' interface FetchOptions { headers?: Record