From 1958cf2c01766bab71df40778208ece19dc091df Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Fri, 28 Nov 2025 20:51:14 +0100 Subject: [PATCH] fix(chat): resolve CORS and build issues for local development MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add webpack builder to nest-cli.json to fix tsc noEmit issue - Add localhost:5178 to CORS whitelist in backend - Fix auth token key in api.ts to match @manacore/shared-auth storage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- apps/chat/apps/backend/nest-cli.json | 3 ++- apps/chat/apps/backend/src/main.ts | 1 + apps/chat/apps/web/src/lib/services/api.ts | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/chat/apps/backend/nest-cli.json b/apps/chat/apps/backend/nest-cli.json index 97f80c1d1..a0f20b253 100644 --- a/apps/chat/apps/backend/nest-cli.json +++ b/apps/chat/apps/backend/nest-cli.json @@ -5,6 +5,7 @@ "compilerOptions": { "deleteOutDir": true, "assets": [], - "watchAssets": false + "watchAssets": false, + "webpack": true } } diff --git a/apps/chat/apps/backend/src/main.ts b/apps/chat/apps/backend/src/main.ts index 8d4eb0f92..3345844c2 100644 --- a/apps/chat/apps/backend/src/main.ts +++ b/apps/chat/apps/backend/src/main.ts @@ -10,6 +10,7 @@ async function bootstrap() { origin: [ 'http://localhost:3000', 'http://localhost:5173', + 'http://localhost:5178', // Chat web app 'http://localhost:8081', 'exp://localhost:8081', 'http://localhost:3001', // Mana Core Auth diff --git a/apps/chat/apps/web/src/lib/services/api.ts b/apps/chat/apps/web/src/lib/services/api.ts index 1a14ce2f8..13ad04f88 100644 --- a/apps/chat/apps/web/src/lib/services/api.ts +++ b/apps/chat/apps/web/src/lib/services/api.ts @@ -23,9 +23,10 @@ async function fetchApi( const { method = 'GET', body, token } = options; // Get token from localStorage if not provided + // Token is stored by @manacore/shared-auth under '@auth/appToken' let authToken = token; if (!authToken && browser) { - authToken = localStorage.getItem('mana_token') || undefined; + authToken = localStorage.getItem('@auth/appToken') || undefined; } if (!authToken) {