secure /api/brands/** endpoint and update CORS configuration
This commit is contained in:
@@ -40,6 +40,7 @@ public class SecurityConfig {
|
||||
.authorizeHttpRequests(authz -> authz
|
||||
.requestMatchers("/api/auth/**").permitAll()
|
||||
.requestMatchers("/api/users/**").authenticated()
|
||||
.requestMatchers("/api/brands/**").authenticated()
|
||||
.anyRequest().permitAll()
|
||||
)
|
||||
|
||||
@@ -58,7 +59,7 @@ public class SecurityConfig {
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("http://localhost:4200", "http://127.0.0.1:4200") // Ton front
|
||||
.allowedOrigins("http://localhost:4200", "http://127.0.0.1:4200")
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
||||
.allowedHeaders("*")
|
||||
.allowCredentials(true);
|
||||
|
||||
Reference in New Issue
Block a user