Skip to content

Commit

Permalink
Use AbstractHttpConfigurer::disable to disable csrf instead of lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
64ArthurAraujo committed Jun 5, 2024
1 parent 2a99cd6 commit f5e4c34
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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;

Expand All @@ -37,7 +38,7 @@ public class SecurityConfiguration {

@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.csrf(csrf -> csrf.disable());
http.csrf(AbstractHttpConfigurer::disable);

http.sessionManagement(management -> management
.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
Expand Down

0 comments on commit f5e4c34

Please sign in to comment.