🐛 fix(mana-core-auth): add explicit urlencoded body parser for OAuth token endpoint

This commit is contained in:
Till-JS 2026-02-01 03:56:17 +01:00
parent 191c7b4cc7
commit 550083241f
12 changed files with 627 additions and 204 deletions

View file

@ -1,7 +1,7 @@
import { NestFactory } from '@nestjs/core';
import { ValidationPipe, RequestMethod } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { Request, Response, NextFunction } from 'express';
import { Request, Response, NextFunction, urlencoded, json } from 'express';
import helmet from 'helmet';
import cookieParser from 'cookie-parser';
import { AppModule } from './app.module';
@ -69,6 +69,10 @@ async function bootstrap() {
);
app.use(cookieParser());
// Explicit body parsers for form-urlencoded (needed for OAuth2 token endpoint)
app.use(json());
app.use(urlencoded({ extended: true }));
// CORS configuration
const corsOrigins = configService.get<string[]>('cors.origin') || [];
console.log('📋 CORS Origins configured:', corsOrigins);