Skip to content

Commit

Permalink
configure cors
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanSerkovich committed Aug 27, 2024
1 parent e5ea2cb commit 861c667
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ public SecurityWebFilterChain securityFilterChain(@NonNull ServerHttpSecurity ht
.permitAll()
.anyExchange().authenticated()
)
.cors(corsSpec -> corsSpec.configurationSource(exchange -> {
var config = new org.springframework.web.cors.CorsConfiguration();
config.setAllowedOrigins(java.util.List.of("*"));
config.setAllowedMethods(java.util.List.of("*"));
config.setAllowedHeaders(java.util.List.of("*"));
return config;
}))
.build();
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spring:
corsConfigurations:
'[/**]':
allow-credentials: true
allowed-origins: ${ORIGINS:http://localhost:${server.port},http://localhost:3000}
allowed-origins: ${ORIGINS:http://localhost:${server.port},${FRONT_HOST},http://localhost:3000}
allowed-headers: '*'
allowed-methods: '*'
discovery:
Expand Down

0 comments on commit 861c667

Please sign in to comment.