Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/main/java/server/loop/global/config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ public PasswordEncoder passwordEncoder() {
@Bean
public CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration configuration = new CorsConfiguration();
// 로컬 환경과 배포 환경 모두 명시
configuration.setAllowedOrigins(List.of(
"http://localhost:5173", // 로컬 프론트엔드 개발 환경
"http://localhost:8080", // 로컬 백엔드 서버(테스트용)
"https://*.vercel.app", // Vercel 배포 환경
configuration.setAllowedOriginPatterns(List.of(
"http://localhost:5173", // 로컬 개발 환경
"https://*.vercel.app", // Vercel 모든 배포 환경
"https://loop.o-r.kr", // 커스텀 도메인
"https://www.loop.o-r.kr" // www 서브도메인
));
Expand All @@ -55,7 +53,7 @@ public CorsConfigurationSource corsConfigurationSource() {
return source;
}

// OPTIONS 요청 전역 허용은 이미 잘 설정되어 있으므로 유지하면 됩니다.
// OPTIONS 요청 전역 허용
@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return (web) -> web.ignoring().requestMatchers(HttpMethod.OPTIONS, "/**");
Expand Down