Skip to content

Commit

Permalink
feat: Spring Security csrf 및 cors 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
juno-junho committed Oct 24, 2023
1 parent 67a1ff7 commit 4257b22
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/java/com/spaceclub/global/config/SecurityConfig.java
Original file line number Diff line number Diff line change
@@ -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();
}

}

0 comments on commit 4257b22

Please sign in to comment.