diff --git a/backend/infrastructure/security/src/main/kotlin/at/mocode/infrastructure/security/GlobalSecurityConfig.kt b/backend/infrastructure/security/src/main/kotlin/at/mocode/infrastructure/security/GlobalSecurityConfig.kt index 049465ff..141ffceb 100644 --- a/backend/infrastructure/security/src/main/kotlin/at/mocode/infrastructure/security/GlobalSecurityConfig.kt +++ b/backend/infrastructure/security/src/main/kotlin/at/mocode/infrastructure/security/GlobalSecurityConfig.kt @@ -86,8 +86,12 @@ class GlobalSecurityConfig { "https://api.mo-code.at", "http://localhost:8080", "http://localhost:8083", + "http://localhost:8092", "http://localhost:4000" ) + configuration.allowedOriginPatterns = listOf( + "https://*.mo-code.at" + ) configuration.allowedMethods = listOf("GET", "POST", "PUT", "DELETE", "OPTIONS") configuration.allowedHeaders = listOf("*") configuration.allowCredentials = true diff --git a/docs/03_Journal/2026-04-23_Plan-B-Formulare.md b/docs/03_Journal/2026-04-23_Plan-B-Formulare.md index bdfc678c..7412049e 100644 --- a/docs/03_Journal/2026-04-23_Plan-B-Formulare.md +++ b/docs/03_Journal/2026-04-23_Plan-B-Formulare.md @@ -57,3 +57,10 @@ Die "Hallo Du!" Test-UI wurde durch produktive, fachlich korrekte Formulare erse - **Lösung**: - `build.gradle.kts` (mail-service): `spring-boot-starter-security`, `spring-boot-starter-oauth2-resource-server` und das `infrastructure:security` Modul explizit als Abhängigkeiten hinzugefügt. - UI-Marker auf `v2026-04-23.17 - SECURITY DEPENDENCY FIX` aktualisiert. + +### v2026-04-23.18 - RADICAL CORS PERMISSIVENESS +- **Problem**: Trotz hinzugefügter Security-Abhängigkeiten wurde der CORS-Header `Access-Control-Allow-Origin` weiterhin blockiert (Preflight-Failure). +- **Lösung**: + - `GlobalSecurityConfig.kt`: `allowedOriginPatterns` mit `https://*.mo-code.at` hinzugefügt, um alle Subdomains von mo-code.at explizit abzudecken. + - Prüfung der Filterkette: Sichergestellt, dass `.cors()` vor der Authentifizierung konfiguriert ist (bereits korrekt, aber durch Patterns verstärkt). +- **Status**: Bereit zum Test. Versionsmarker auf v18 aktualisiert. diff --git a/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt b/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt index c23cacd4..b2e0098c 100644 --- a/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt +++ b/frontend/shells/meldestelle-web/src/wasmJsMain/kotlin/at/mocode/frontend/shell/web/WebMainScreen.kt @@ -124,7 +124,7 @@ fun MainAppContent() { // Dezentraler Versions-Marker in der unteren rechten Ecke Box(modifier = Modifier.fillMaxSize().padding(8.dp), contentAlignment = Alignment.BottomEnd) { Text( - text = "v2026-04-23.17 - SECURITY DEPENDENCY FIX", + text = "v2026-04-23.18 - RADICAL CORS PERMISSIVENESS", style = MaterialTheme.typography.labelSmall, color = Color.LightGray.copy(alpha = 0.5f) )