diff --git a/src/main/java/store/itpick/backend/config/WebConfig.java b/src/main/java/store/itpick/backend/config/WebConfig.java index 6a863ef..aea343c 100644 --- a/src/main/java/store/itpick/backend/config/WebConfig.java +++ b/src/main/java/store/itpick/backend/config/WebConfig.java @@ -39,12 +39,20 @@ public void addArgumentResolvers(List resolvers) resolvers.add(getJwtHandlerArgumentResolver); } -// @Override -// public void addCorsMappings(CorsRegistry registry) { -// registry.addMapping("/**") -// .allowedOrigins("https://itpick.netlify.app") -// .allowedMethods("GET", "POST", "PUT", "DELETE", "HEAD") -// .allowedHeaders("Authorization", "Content-Type") -// .allowCredentials(true); -// } + + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOriginPatterns("http://localhost:3000/", "http://localhost:5173/", "https://localhost:5173/", + "https://itpick.netlify.app") + .allowedMethods("GET", "POST", "PUT", "DELETE", "PATCH") + .exposedHeaders("location", "Authorization") + .allowedHeaders("*") + .allowCredentials(true); + } + + + + } \ No newline at end of file