From 3be20a1a9df90ddf3b45c4e812d0bc5cfef734af Mon Sep 17 00:00:00 2001 From: Niklas Kerkhoff Date: Mon, 18 Nov 2024 03:07:38 +0100 Subject: [PATCH] remove cors config --- .../config/SecurityConfig.kt | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tutor-assistant-app-service/src/main/kotlin/de/niklaskerkhoff/tutorassistantappservice/config/SecurityConfig.kt b/tutor-assistant-app-service/src/main/kotlin/de/niklaskerkhoff/tutorassistantappservice/config/SecurityConfig.kt index c8d9b27..534860a 100644 --- a/tutor-assistant-app-service/src/main/kotlin/de/niklaskerkhoff/tutorassistantappservice/config/SecurityConfig.kt +++ b/tutor-assistant-app-service/src/main/kotlin/de/niklaskerkhoff/tutorassistantappservice/config/SecurityConfig.kt @@ -21,7 +21,7 @@ class SecurityConfig { fun securityFilterChain(http: HttpSecurity): SecurityFilterChain { http { csrf { disable() } - cors { } +// cors { } authorizeRequests { authorize(anyRequest, authenticated) } @@ -37,22 +37,22 @@ class SecurityConfig { return http.build() } - @Bean - fun corsFilter(): CorsFilter { - val source = UrlBasedCorsConfigurationSource() - val config = CorsConfiguration() - config.allowCredentials = true - config.allowedOrigins = listOf( - "http://localhost:5173", - "http://localhost:5174", - ) - config.allowedHeaders = listOf( - "Origin", "Content-Type", "Accept", "Authorization", - "Access-Control-Allow-Origin" - ) - config.allowedMethods = - listOf("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS") - source.registerCorsConfiguration("/**", config) - return CorsFilter(source) - } +// @Bean +// fun corsFilter(): CorsFilter { +// val source = UrlBasedCorsConfigurationSource() +// val config = CorsConfiguration() +// config.allowCredentials = true +// config.allowedOrigins = listOf( +// "http://localhost:5173", +// "http://localhost:5174", +// ) +// config.allowedHeaders = listOf( +// "Origin", "Content-Type", "Accept", "Authorization", +// "Access-Control-Allow-Origin" +// ) +// config.allowedMethods = +// listOf("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS") +// source.registerCorsConfiguration("/**", config) +// return CorsFilter(source) +// } }