diff --git a/src/main/java/com/sanbosillok/sanbosillokserver/config/SecurityConfig.java b/src/main/java/com/sanbosillok/sanbosillokserver/config/SecurityConfig.java index e1a121f..eeb7677 100644 --- a/src/main/java/com/sanbosillok/sanbosillokserver/config/SecurityConfig.java +++ b/src/main/java/com/sanbosillok/sanbosillokserver/config/SecurityConfig.java @@ -78,10 +78,9 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { //경로별 인가 작업 .authorizeHttpRequests((auth) -> auth .requestMatchers("/signup", "/login", "/checkUserName/{username}").permitAll() - .requestMatchers(HttpMethod.GET, "/post", "/post/{title}", "/post/random").hasAnyRole("GUEST", "ACTIVE", "ADMIN") - .requestMatchers("/post", "/post/{title}", "/post/upload").hasAnyRole("ACTIVE", "ADMIN") - .requestMatchers("/admin", "/admin/{id}").hasRole("ADMIN") - .anyRequest().authenticated()) + .requestMatchers(HttpMethod.GET, "/post", "/post/random", "/post/{title}", "/image/{fileName}").hasAnyRole("GUEST", "ACTIVE", "ADMIN") + .requestMatchers("/post", "/post/upload", "/post/{title}").hasAnyRole("ACTIVE", "ADMIN") + .requestMatchers("/admin", "/admin/{id}").hasRole("ADMIN")) // 필터 등록 .addFilterAt(new LoginFilter(authenticationManager(authenticationConfiguration), jwtTokenProvider, objectMapper), UsernamePasswordAuthenticationFilter.class)