Skip to content

Commit a589b63

Browse files
committed
assets 필터 무시
1 parent 12f7b22 commit a589b63

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

backend/src/main/java/_team/onmyway/config/SecurityConfig.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import _team.onmyway.security.JwtAuthenticationFilter;
77
import _team.onmyway.service.CustomOAuthUserService;
88
import lombok.RequiredArgsConstructor;
9+
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
10+
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
911
import org.springframework.web.cors.CorsConfiguration;
1012
import org.springframework.web.cors.CorsConfigurationSource;
1113
import 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

Comments
 (0)