Skip to content

Commit c7c1797

Browse files
Merge pull request #33 from SmartPotTech/alert-autofix-6
Potential fix for code scanning alert no. 6: Disabled Spring CSRF protection
2 parents d0f5a9a + ed3bd89 commit c7c1797

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/smartpot/com/api/Security/Config/SecurityConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity httpSec) throws Exce
5959
}
6060

6161
return httpSec
62-
.csrf(AbstractHttpConfigurer::disable) // Enable CSRF protection
62+
.csrf(Customizer.withDefaults()) // Enable CSRF protection
6363
.cors(cors -> cors.configurationSource(corsConfig))
6464
.authorizeHttpRequests(authorizationManagerRequestMatcherRegistry -> {
6565
authorizationManagerRequestMatcherRegistry.requestMatchers(publicRoutesList.toArray(new String[0])).permitAll();

0 commit comments

Comments
 (0)