From cdc3f3cc4be88b559fefb4d10cdf8be31b08437c Mon Sep 17 00:00:00 2001 From: kangseungmin Date: Wed, 21 Aug 2024 12:57:04 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20SecurityConfig=20csrf=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EB=B9=84=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bbteam/budgetbuddies/global/config/SecurityConfig.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/bbteam/budgetbuddies/global/config/SecurityConfig.java b/src/main/java/com/bbteam/budgetbuddies/global/config/SecurityConfig.java index dc28772d..d8b7e218 100644 --- a/src/main/java/com/bbteam/budgetbuddies/global/config/SecurityConfig.java +++ b/src/main/java/com/bbteam/budgetbuddies/global/config/SecurityConfig.java @@ -6,6 +6,7 @@ import org.springframework.core.env.Environment; 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.configurers.AbstractHttpConfigurer; import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.provisioning.InMemoryUserDetailsManager; @@ -29,6 +30,7 @@ public SecurityConfig(Environment env) { @Bean public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { http + .csrf(AbstractHttpConfigurer::disable) // csrf 설정 비활성화 .authorizeHttpRequests(authorizeRequests -> authorizeRequests .requestMatchers("/swagger-ui/**", "/v3/api-docs/**").hasRole("ADMIN")