fix: Security Config

This commit is contained in:
yuhalog 2025-06-18 13:53:51 +09:00
parent 2e8055df2d
commit 82516174d3

View File

@ -43,17 +43,7 @@ public class SecurityConfig {
.cors(cors -> cors.configurationSource(corsConfigurationSource()))
.sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
.authorizeHttpRequests(auth -> auth
.requestMatchers("/api/auth/**", "/api/member/register", "/api/member/check-duplicate/**",
"/api/member/validate-password", "/swagger-ui/**", "/v3/api-docs/**",
"/swagger-resources/**", "/webjars/**", "/actuator/**", "/health/**", "/error"
).permitAll()
// Rewrite된 경로들 허용 (새로 추가!)
.requestMatchers("/login", "/register", "/auth/**").permitAll() // Member 서비스
.requestMatchers("/stores", "/stores/**").permitAll() // Store 서비스
.requestMatchers("/content", "/content/**").permitAll() // Content 서비스
.requestMatchers("/recommend", "/recommend/**").permitAll() // AI Recommend 서비스
.anyRequest().authenticated()
.anyRequest().permitAll()
)
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);