|
|
@@ -32,9 +32,11 @@ public class SecurityConfiguration {
|
|
|
.cors(Customizer.withDefaults())
|
|
|
.exceptionHandling(Customizer.withDefaults())
|
|
|
//.sessionManagement(sessionManagementConfigurer -> sessionManagementConfigurer.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
|
|
+ //.httpBasic(Customizer.withDefaults())
|
|
|
.authorizeHttpRequests(authorizationRegistry -> authorizationRegistry
|
|
|
.requestMatchers("/login", "/images/**", "/css/**","/error/**").permitAll()
|
|
|
.requestMatchers(HttpMethod.POST, "/authentication/login").permitAll()
|
|
|
+ .requestMatchers("/api/**").authenticated()
|
|
|
.requestMatchers("/compra", "/compra/**").hasRole(UserRole.ADMIN.toString())
|
|
|
.anyRequest().authenticated())
|
|
|
.addFilterBefore(authorizationFilter, UsernamePasswordAuthenticationFilter.class)
|