Update CORS allowed origins configuration

Consolidated the allowed origins into a single `allowedOrigins` call. This ensures both local and production environments are correctly configured for CORS.
This commit is contained in:
Teriuihi 2024-08-06 23:16:38 +02:00
parent 34255c93c8
commit 04088c20e5

View File

@ -15,8 +15,7 @@ public class WebConfig implements WebMvcConfigurer { //TODO this can be done wit
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/api/**")
.allowedOrigins("http://localhost:3000")
.allowedOrigins("https://forms.alttd.com")
.allowedOrigins("http://localhost:3000", "https://forms.alttd.com")
.allowedMethods("GET", "POST", "PUT", "DELETE")
.allowedHeaders("*")
.allowCredentials(true);