Skip to content

Commit a85e34d

Browse files
committed
[CICD] securityConfig, WebConfig 수정
1 parent c169503 commit a85e34d

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

src/main/java/fitfit/global/config/WebConfig.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,4 @@
77
@Configuration
88
public class WebConfig implements WebMvcConfigurer {
99

10-
@Override
11-
public void addCorsMappings(CorsRegistry registry) {
12-
registry.addMapping("/**") // 모든 경로에 대해
13-
.allowedOrigins("https://d3trbid3w75opm.cloudfront.net", "http://localhost:3000", "https://fitfit.site", "http://localhost:5173") // CloudFront와 로컬 개발 환경 허용
14-
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
15-
.allowedHeaders("*")
16-
.allowCredentials(true)
17-
.maxAge(3600);
18-
}
1910
}

src/main/java/fitfit/global/security/config/SecurityConfig.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ public SecurityFilterChain filterChain (HttpSecurity http) throws Exception {
5757
@Bean
5858
public CorsConfigurationSource corsConfigurationSource() {
5959
CorsConfiguration config = new CorsConfiguration();
60-
config.setAllowedOrigins(List.of("*")); // 일단 전체 허용 (추후 변경 가능성 있음)
60+
config.setAllowedOrigins(List.of("https://d3trbid3w75opm.cloudfront.net", "http://localhost:3000", "https://fitfit.site", "http://localhost:5173"));
6161
config.setAllowedMethods(List.of("GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
6262
config.setAllowedHeaders(List.of("*"));
63-
config.setAllowCredentials(false); // 헤더에 토큰만 보내므로 false
64-
config.setExposedHeaders(List.of("Authorization")); // iOS 앱에서 Authorization 헤더 읽을 수 있도록 노출
63+
config.setAllowCredentials(true);
64+
config.setExposedHeaders(List.of("Authorization"));
6565

6666
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
6767
source.registerCorsConfiguration("/**", config);

0 commit comments

Comments
 (0)