From 6df5bd193a85aa281121650774b28a68f259b916 Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Tue, 28 Oct 2025 07:55:30 -0600 Subject: [PATCH] Fix CORS configuration: Add frontend:806 to allowed origins and set FRONTEND_URL --- backend/.env | 1 + backend/src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/.env b/backend/.env index 76ad7bca..19a5d1a9 100644 --- a/backend/.env +++ b/backend/.env @@ -25,3 +25,4 @@ MAX_FILE_SIZE=10485760 NODE_ENV=development PORT=3001 LOG_LEVEL=info +FRONTEND_URL=https://mad-lawsuit.org diff --git a/backend/src/index.ts b/backend/src/index.ts index 39ae4fb3..9d55abf0 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -58,8 +58,8 @@ app.use(helmet({ // CORS configuration app.use(cors({ origin: process.env.NODE_ENV === 'production' - ? process.env.FRONTEND_URL - : ['http://localhost:3000', 'http://frontend:3000'], + ? [process.env.FRONTEND_URL, 'http://frontend:806', 'http://localhost:806'] + : ['http://localhost:3000', 'http://localhost:806', 'http://frontend:806', 'http://frontend:3000'], credentials: true, }));