mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:01:08 +02:00
fix(mana-core-auth): configure helmet for cross-origin requests
Update helmet middleware to allow cross-origin resource policy and opener policy for proper CORS functionality with frontend apps. Also add debug logging for configured CORS origins. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
12f59176dd
commit
dbf5745c0e
1 changed files with 8 additions and 2 deletions
|
|
@ -10,12 +10,18 @@ async function bootstrap() {
|
|||
|
||||
const configService = app.get(ConfigService);
|
||||
|
||||
// Security middleware
|
||||
app.use(helmet());
|
||||
// Security middleware - configure helmet to allow CORS
|
||||
app.use(
|
||||
helmet({
|
||||
crossOriginResourcePolicy: { policy: 'cross-origin' },
|
||||
crossOriginOpenerPolicy: { policy: 'same-origin-allow-popups' },
|
||||
})
|
||||
);
|
||||
app.use(cookieParser());
|
||||
|
||||
// CORS configuration
|
||||
const corsOrigins = configService.get<string[]>('cors.origin') || [];
|
||||
console.log('📋 CORS Origins configured:', corsOrigins);
|
||||
app.enableCors({
|
||||
origin: corsOrigins,
|
||||
credentials: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue