diff --git a/src/main/java/dongguk/osori/config/SecurityConfig.java b/src/main/java/dongguk/osori/config/SecurityConfig.java index 51803d9..161ae92 100644 --- a/src/main/java/dongguk/osori/config/SecurityConfig.java +++ b/src/main/java/dongguk/osori/config/SecurityConfig.java @@ -68,13 +68,13 @@ public PasswordEncoder passwordEncoder() { @Bean public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); - configuration.setAllowedOrigins(List.of("http://localhost:3000")); // 정확한 오리진 설정 - configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH")); // 허용할 HTTP 메서드 - configuration.setAllowedHeaders(List.of("Authorization", "Cache-Control", "Content-Type")); // 허용할 HTTP 헤더 - configuration.setAllowCredentials(true); // 자격 증명 허용 + configuration.setAllowedOrigins(List.of("http://localhost:3000", "https://2024-2-oss-proj-osori-fe.vercel.app")); + configuration.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH")); + configuration.setAllowedHeaders(List.of("Authorization", "Cache-Control", "Content-Type")); + configuration.setAllowCredentials(true); UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - source.registerCorsConfiguration("/**", configuration); // 모든 경로에 대해 설정 적용 + source.registerCorsConfiguration("/**", configuration); return source; } }