From 696ac3da0fdccafeaf9e5cc4762cda72a7d43c97 Mon Sep 17 00:00:00 2001 From: ddongseop Date: Wed, 17 Jan 2024 13:15:43 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[FIX]=20CORS=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=ED=95=B4=EA=B2=B0=20=EB=B6=88=ED=95=84=EC=9A=94=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/config/SecurityConfig.java | 24 ------------------- src/main/resources/logback-dev.xml | 4 ---- src/main/resources/logback-local.xml | 4 ---- 3 files changed, 32 deletions(-) diff --git a/src/main/java/org/sopt/lequuServer/global/config/SecurityConfig.java b/src/main/java/org/sopt/lequuServer/global/config/SecurityConfig.java index 18e2156..409e640 100644 --- a/src/main/java/org/sopt/lequuServer/global/config/SecurityConfig.java +++ b/src/main/java/org/sopt/lequuServer/global/config/SecurityConfig.java @@ -7,14 +7,10 @@ import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer; import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -import org.springframework.web.filter.CorsFilter; import static org.sopt.lequuServer.global.auth.security.AuthWhiteList.AUTH_WHITELIST; @@ -42,24 +38,4 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { .addFilterBefore(jwtExceptionFilter, JwtAuthenticationFilter.class) .build(); } - - @Bean - public CorsFilter corsFilter() { - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - - CorsConfiguration config = new CorsConfiguration(); - config.setAllowCredentials(true); - config.addAllowedOrigin("*"); - config.addAllowedHeader("*"); - config.addAllowedMethod("*"); - source.registerCorsConfiguration("/v3/api-docs", config); - return new CorsFilter(source); - } - - @Bean - public WebSecurityCustomizer webSecurityCustomizer() { - return web -> web.ignoring().requestMatchers( - "/swagger-ui/**", "/swagger-resources/**", "/api-docs/**", - "/v3/api-docs/**", "/webjars/**"); - } } \ No newline at end of file diff --git a/src/main/resources/logback-dev.xml b/src/main/resources/logback-dev.xml index dbd84bb..4e6f3af 100644 --- a/src/main/resources/logback-dev.xml +++ b/src/main/resources/logback-dev.xml @@ -27,10 +27,6 @@ - - \ No newline at end of file diff --git a/src/main/resources/logback-local.xml b/src/main/resources/logback-local.xml index 2631145..b571506 100644 --- a/src/main/resources/logback-local.xml +++ b/src/main/resources/logback-local.xml @@ -10,9 +10,5 @@ - - \ No newline at end of file