mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:41:09 +02:00
fix(chat): resolve CORS and build issues for local development
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
79acf8b8b8
commit
1958cf2c01
3 changed files with 5 additions and 2 deletions
|
|
@ -5,6 +5,7 @@
|
|||
"compilerOptions": {
|
||||
"deleteOutDir": true,
|
||||
"assets": [],
|
||||
"watchAssets": false
|
||||
"watchAssets": false,
|
||||
"webpack": true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -23,9 +23,10 @@ async function fetchApi<T>(
|
|||
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue