//TODO WebSecurityConfig
This commit is contained in:
@@ -26,7 +26,13 @@ public class WebSecurityConfig {
|
|||||||
.cors(cors -> cors.configurationSource(corsConfigurationSource()))
|
.cors(cors -> cors.configurationSource(corsConfigurationSource()))
|
||||||
.csrf(csrf -> csrf.disable())
|
.csrf(csrf -> csrf.disable())
|
||||||
.authorizeHttpRequests(auth -> auth
|
.authorizeHttpRequests(auth -> auth
|
||||||
.requestMatchers(HttpMethod.OPTIONS, "/", "/public", "/coach/**","/athlete/**").permitAll() // allow coach endpoints
|
// TODO //TODO // T O D O
|
||||||
|
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
|
||||||
|
// 2. Allow public endpoints BEFORE any authenticated() calls
|
||||||
|
.requestMatchers("/athlete/create", "/", "/public").permitAll()
|
||||||
|
.requestMatchers("/coach/**").permitAll()
|
||||||
|
// 3. Authenticated endpoints
|
||||||
|
.requestMatchers("/users/sync").authenticated()
|
||||||
.requestMatchers("/admin/**").hasRole("admin")
|
.requestMatchers("/admin/**").hasRole("admin")
|
||||||
.requestMatchers("/user/**").hasRole("user")
|
.requestMatchers("/user/**").hasRole("user")
|
||||||
.anyRequest().authenticated())
|
.anyRequest().authenticated())
|
||||||
|
|||||||
Reference in New Issue
Block a user