From 9765d2be32f6265aa31b8b4e9667d820fa0861a4 Mon Sep 17 00:00:00 2001 From: mikicv Date: Wed, 8 Oct 2025 23:13:13 +0100 Subject: [PATCH] fix prod --- Dockerfile.production | 1 + lib/session.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile.production b/Dockerfile.production index b582393..6738f58 100644 --- a/Dockerfile.production +++ b/Dockerfile.production @@ -42,6 +42,7 @@ WORKDIR /app ENV NODE_ENV=production ENV NEXT_TELEMETRY_DISABLED=1 +ENV TRUST_PROXY=1 # Copy necessary files from builder stage COPY --from=builder /app/.next/standalone ./ diff --git a/lib/session.ts b/lib/session.ts index 07af3b1..a61aaee 100644 --- a/lib/session.ts +++ b/lib/session.ts @@ -57,7 +57,7 @@ export async function createSession(payload: Omit) cookieStore.set('session', session, { httpOnly: true, - secure: process.env.NODE_ENV === 'production', + secure: true, // Always secure in production expires: expiresAt, sameSite: 'lax', path: '/', @@ -78,7 +78,7 @@ export async function updateSession() { cookieStore.set('session', newSession, { httpOnly: true, - secure: process.env.NODE_ENV === 'production', + secure: true, // Always secure in production expires: expires, sameSite: 'lax', path: '/',