diff --git a/src/main/java/com/ceos/vote/common/config/CorsConfig.java b/src/main/java/com/ceos/vote/common/config/CorsConfig.java index 435739d..c24d441 100644 --- a/src/main/java/com/ceos/vote/common/config/CorsConfig.java +++ b/src/main/java/com/ceos/vote/common/config/CorsConfig.java @@ -11,17 +11,18 @@ public class CorsConfig { @Value("${domain}") - private String domain; + private String clientUrl; @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); - config.addAllowedOrigin(domain); + config.addAllowedOrigin("http://localhost:3000"); + config.addAllowedOrigin(clientUrl); config.addAllowedHeader("*"); config.addAllowedMethod("*"); - source.registerCorsConfiguration("/**",config); + source.registerCorsConfiguration("/**", config); return new CorsFilter(source); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3725fc4..cfb036d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -44,4 +44,4 @@ springdoc: swagger-ui: path: /swagger-vote.html -domain: ENC(wtMoW4E5IOZgq215uWHzGsBlrqecbyNr9lsrql5da0LFtz4cywsN8Fap3bhNqVYQ0RuvblLIewQZo+u8pBCaFA==) \ No newline at end of file +clientUrl: ENC(xZJ/NyHwyN5VEY3W6Btq++gSySY0VzGxn9iJuP25Wj3vmwGsulhgRQ==) \ No newline at end of file