From 4257b22d0969a95f3cdc4ab3796adad63e296b56 Mon Sep 17 00:00:00 2001 From: junho Date: Mon, 23 Oct 2023 22:38:39 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Spring=20Security=20csrf=20=EB=B0=8F=20?= =?UTF-8?q?cors=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/config/SecurityConfig.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/main/java/com/spaceclub/global/config/SecurityConfig.java diff --git a/src/main/java/com/spaceclub/global/config/SecurityConfig.java b/src/main/java/com/spaceclub/global/config/SecurityConfig.java new file mode 100644 index 00000000..1565ffda --- /dev/null +++ b/src/main/java/com/spaceclub/global/config/SecurityConfig.java @@ -0,0 +1,21 @@ +package com.spaceclub.global.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.web.SecurityFilterChain; + +@Configuration +public class SecurityConfig { + + @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + return http + .cors(Customizer.withDefaults()) + .csrf(AbstractHttpConfigurer::disable) + .build(); + } + +}