66import _team .onmyway .security .JwtAuthenticationFilter ;
77import _team .onmyway .service .CustomOAuthUserService ;
88import lombok .RequiredArgsConstructor ;
9+ import org .springframework .security .config .annotation .web .configuration .WebSecurityCustomizer ;
10+ import org .springframework .security .web .util .matcher .AntPathRequestMatcher ;
911import org .springframework .web .cors .CorsConfiguration ;
1012import org .springframework .web .cors .CorsConfigurationSource ;
1113import org .springframework .web .cors .UrlBasedCorsConfigurationSource ;
@@ -37,7 +39,7 @@ SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
3739 "/" ,
3840 "/find-route" ,
3941 "/index.html" ,
40- "/assets/**" ,
42+ // "/assets/**",
4143 "/login" ,
4244 "/error" ,
4345 "/oauth2/authorization/**" ,
@@ -48,7 +50,7 @@ SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
4850 "/places/**" ,
4951 "/route/**"
5052 ).permitAll () // 요청을 보낸 이가 누구이든 상관없이 통과되는 URL.
51- .requestMatchers ( "/css/**" , "/js/**" , "/images/**" , "/favicon.ico" ).permitAll ()
53+ .requestMatchers ( "/css/**" , "/js/**" , "/images/**" ).permitAll ()
5254 .anyRequest ().authenticated ()
5355 )
5456 .csrf (csrf -> csrf .disable ())
@@ -85,4 +87,12 @@ public CorsConfigurationSource corsConfigurationSource() {
8587
8688 return source ;
8789 }
90+
91+ @ Bean
92+ public WebSecurityCustomizer webSecurityCustomizer () {
93+ return webSecurity -> {
94+ webSecurity .ignoring ()
95+ .requestMatchers ("/assets/**" );
96+ };
97+ }
8898}
0 commit comments