1
0
mirror of synced 2026-05-22 13:23:17 +00:00

Fix securityMatchers code sample

Closes gh-12296
This commit is contained in:
Marc Becker
2022-11-25 13:35:48 +01:00
committed by Marcus Hert Da Coregio
parent 08afa1782c
commit 50da5b6498
@@ -409,7 +409,9 @@ import static org.springframework.security.web.util.matcher.AntPathRequestMatche
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.securityMatcher(antMatcher("/api/**"), antMatcher("/app/**"))
.securityMatchers((matchers) -> matchers
.requestMatchers(antMatcher("/api/**"), antMatcher("/app/**"))
)
.authorizeHttpRequests((authz) -> authz
.requestMatchers(antMatcher("/api/admin/**")).hasRole("ADMIN")
.anyRequest().authenticated()