Bimo Abdul Aziz commited on
Commit
889563a
·
1 Parent(s): b5fcd3f

Add localhost CORS and fix production origin

Browse files

Add http://localhost:5173 to allowed CORS origins for local development and remove the trailing slash from https://tebudi.vercel.app so the origin matches exactly. This prevents CORS mismatches between dev and production environments.

src/main/java/com/tebudi/TeBuDi/config/SecurityConfig.java CHANGED
@@ -60,7 +60,8 @@ public class SecurityConfig {
60
  public CorsConfigurationSource corsConfigurationSource() {
61
  CorsConfiguration configuration = new CorsConfiguration();
62
  configuration.setAllowedOrigins(Arrays.asList(
63
- "https://tebudi.vercel.app/"
 
64
  ));
65
  configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
66
  configuration.setAllowedHeaders(Arrays.asList("Authorization", "Content-Type", "Accept"));
 
60
  public CorsConfigurationSource corsConfigurationSource() {
61
  CorsConfiguration configuration = new CorsConfiguration();
62
  configuration.setAllowedOrigins(Arrays.asList(
63
+ "http://localhost:5173",
64
+ "https://tebudi.vercel.app" // ← hapus trailing slash
65
  ));
66
  configuration.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
67
  configuration.setAllowedHeaders(Arrays.asList("Authorization", "Content-Type", "Accept"));