Skip to content

Commit

Permalink
Merge pull request #15 from ssu-Recipable/feat/11/oauth
Browse files Browse the repository at this point in the history
fix: SecutiryConfig cors 설정 수정
  • Loading branch information
Jeongho427 authored May 5, 2024
2 parents 9f67f06 + 55e2b5f commit 24d738c
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.springframework.web.cors.CorsConfigurationSource;

import java.util.Collections;
import java.util.List;

@Configuration
@EnableWebSecurity
Expand All @@ -38,10 +39,10 @@ public CorsConfiguration getCorsConfiguration(HttpServletRequest request) {

CorsConfiguration configuration = new CorsConfiguration();

configuration.setAllowedOrigins(Collections.singletonList("http://localhost:3000"));
configuration.setAllowedMethods(Collections.singletonList("*"));
configuration.setAllowedOrigins(List.of("http://localhost:3000", "https://https://recipable.store"));
configuration.setAllowedMethods(List.of("*"));
configuration.setAllowCredentials(true);
configuration.setAllowedHeaders(Collections.singletonList("*"));
configuration.setAllowedHeaders(List.of("*"));
configuration.setMaxAge(3600L);

configuration.setExposedHeaders(Collections.singletonList("Set-Cookie"));
Expand Down Expand Up @@ -74,8 +75,7 @@ public CorsConfiguration getCorsConfiguration(HttpServletRequest request) {
//경로별 인가 작업
http
.authorizeHttpRequests((auth) -> auth
.requestMatchers("/","/health-check").permitAll()
.anyRequest().authenticated());
.anyRequest().permitAll());

//세션 설정 : STATELESS
http
Expand Down

0 comments on commit 24d738c

Please sign in to comment.