mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 00:41:09 +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
|
|
@ -16,6 +16,7 @@
|
|||
"test:e2e": "playwright test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@manacore/shared-vite-config": "workspace:*",
|
||||
"@playwright/test": "^1.51.0",
|
||||
"@sveltejs/adapter-node": "^5.0.0",
|
||||
"@sveltejs/kit": "^2.47.1",
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
"lint": "eslint ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@manacore/shared-vite-config": "workspace:*",
|
||||
"@sveltejs/adapter-auto": "^7.0.0",
|
||||
"@sveltejs/kit": "^2.47.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
"test:cov": "vitest run --coverage"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@manacore/shared-vite-config": "workspace:*",
|
||||
"@sveltejs/adapter-node": "^5.0.0",
|
||||
"@sveltejs/kit": "^2.47.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
"svelte-i18n": "^4.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@manacore/shared-vite-config": "workspace:*",
|
||||
"@eslint/compat": "^1.4.0",
|
||||
"@eslint/js": "^9.36.0",
|
||||
"@sveltejs/adapter-netlify": "^5.2.3",
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
"format": "prettier --write ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@manacore/shared-vite-config": "workspace:*",
|
||||
"@sveltejs/adapter-auto": "^3.0.0",
|
||||
"@sveltejs/kit": "^2.47.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
"format": "prettier --write ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@manacore/shared-vite-config": "workspace:*",
|
||||
"@sveltejs/adapter-node": "^5.0.0",
|
||||
"@sveltejs/kit": "^2.47.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
"type-check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@manacore/shared-vite-config": "workspace:*",
|
||||
"@sveltejs/adapter-node": "^5.0.0",
|
||||
"@sveltejs/kit": "^2.47.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import { createViteConfig, mergeViteConfig } from '@manacore/shared-vite-config';
|
||||
import { MANACORE_SHARED_PACKAGES } from '@manacore/shared-vite-config';
|
||||
|
||||
const baseConfig = createViteConfig({
|
||||
port: 5195,
|
||||
export default defineConfig({
|
||||
plugins: [tailwindcss(), sveltekit()],
|
||||
server: {
|
||||
port: 5195,
|
||||
strictPort: true,
|
||||
},
|
||||
ssr: {
|
||||
noExternal: [...MANACORE_SHARED_PACKAGES],
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: [...MANACORE_SHARED_PACKAGES],
|
||||
},
|
||||
});
|
||||
|
||||
export default defineConfig(
|
||||
mergeViteConfig(baseConfig, {
|
||||
plugins: [tailwindcss(), sveltekit()],
|
||||
})
|
||||
);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
"format": "prettier --write ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@manacore/shared-vite-config": "workspace:*",
|
||||
"@sveltejs/adapter-node": "^5.0.0",
|
||||
"@sveltejs/kit": "^2.47.1",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Provides consistent SSR and optimization settings.
|
||||
*/
|
||||
|
||||
import type { UserConfig } from 'vite';
|
||||
import type { UserConfig, UserConfigExport } from 'vite';
|
||||
|
||||
/**
|
||||
* Common ManaCore shared packages that need SSR configuration.
|
||||
|
|
@ -108,7 +108,7 @@ export function createViteConfig(options: ViteConfigOptions): Partial<UserConfig
|
|||
export function mergeViteConfig(
|
||||
baseConfig: Partial<UserConfig>,
|
||||
appConfig: Partial<UserConfig>
|
||||
): UserConfig {
|
||||
): UserConfigExport {
|
||||
return {
|
||||
...baseConfig,
|
||||
...appConfig,
|
||||
|
|
|
|||
791
pnpm-lock.yaml
generated
791
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -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