Skip to content

Commit

Permalink
Merge pull request #20 from hyundai-fruitfruit/HEENDY-66-CORS-FIX
Browse files Browse the repository at this point in the history
[HEENDY-66-CORS-FIX] 스프링 시큐리티 부분 CORS 에러 해결
  • Loading branch information
sangeun99 authored Feb 27, 2024
2 parents cf484d4 + f5e10d8 commit 6d7c8e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/hyundai/app/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public class CorsConfig implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000")
.allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
.allowedOrigins("*")
.allowedMethods("*")
.allowedHeaders("*")
.allowCredentials(true)
.maxAge(MAX_AGE_SECS);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/hyundai/app/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public void configure(WebSecurity web) {
public void configure(HttpSecurity httpSecurity) throws Exception {

httpSecurity
.cors().and()
.csrf().disable()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
Expand Down

0 comments on commit 6d7c8e2

Please sign in to comment.