diff --git a/src/main/java/leets/weeth/global/config/SecurityConfig.java b/src/main/java/leets/weeth/global/config/SecurityConfig.java index caff488c..8a035c98 100644 --- a/src/main/java/leets/weeth/global/config/SecurityConfig.java +++ b/src/main/java/leets/weeth/global/config/SecurityConfig.java @@ -91,13 +91,13 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { @Bean - public CorsConfigurationSource corsConfigurationSource() { + public CorsConfigurationSource source() { CorsConfiguration configuration = new CorsConfiguration(); - - configuration.setAllowedOrigins(Arrays.asList("http://localhost:3000")); - configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PATCH", "DELETE")); - configuration.setAllowedHeaders(Arrays.asList("*")); - configuration.setExposedHeaders(Arrays.asList("Authorization, Authorization_refresh")); + configuration.addAllowedOriginPattern("*"); + configuration.addAllowedHeader("*"); + configuration.addAllowedMethod("*"); + configuration.addExposedHeader("Authorization"); + configuration.addExposedHeader("Authorization_refresh"); configuration.setAllowCredentials(true); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();