mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-22 05:26:41 +02:00
🐛 fix(mana-core-auth): add explicit urlencoded body parser for OAuth token endpoint
This commit is contained in:
parent
191c7b4cc7
commit
550083241f
12 changed files with 627 additions and 204 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue