From 6e172ba8355feed373adc027eac025671953a34b Mon Sep 17 00:00:00 2001 From: seungwookc97 Date: Thu, 16 Oct 2025 11:09:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=ED=95=84=ED=84=B0=20=EB=A1=A4=EB=B0=B1=20?= =?UTF-8?q?=EB=B0=8F=20category=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../back/global/security/SecurityConfig.java | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/back/global/security/SecurityConfig.java b/src/main/java/com/back/global/security/SecurityConfig.java index 0009dcb..32e2327 100644 --- a/src/main/java/com/back/global/security/SecurityConfig.java +++ b/src/main/java/com/back/global/security/SecurityConfig.java @@ -69,28 +69,26 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { .requestMatchers("/login/oauth2/**").permitAll() .requestMatchers("/h2-console/**").permitAll() - //르프레시 갱신 및 칵테일 검색 + //리프레시 갱신 및 칵테일 검색 .requestMatchers(GET, "/user/auth/me").permitAll() .requestMatchers(POST, "/user/auth/refresh").permitAll() - .requestMatchers(GET, "/cocktails").permitAll() - .requestMatchers(GET, "/cocktails/{id}").permitAll() .requestMatchers(POST, "/cocktails/search").permitAll() - .requestMatchers(GET, "/cocktails/{id}/share").permitAll() // 권한 불필요 - 조회 API .requestMatchers(GET, "/").permitAll() .requestMatchers(GET, "/actuator/**").permitAll() - - .requestMatchers(GET, "/posts").permitAll() - .requestMatchers(GET, "/posts/{postId}").permitAll() - .requestMatchers(GET, "/posts/{postId}/comments").permitAll() - .requestMatchers(GET, "/posts/{postId}/comments/{commentId}").permitAll() - .requestMatchers(GET, "/cocktails/{cocktailId}/comments").permitAll() - .requestMatchers(GET, "/cocktails/{cocktailId}/comments/{cocktailCommentId}").permitAll() - .requestMatchers(GET, "/category").permitAll() - - // 나머지 모든 API는 인증 필요 - .anyRequest().authenticated() + .requestMatchers(GET, "/cocktails/**").permitAll() + + .requestMatchers(GET, "/posts").permitAll() + .requestMatchers(GET, "/posts/{postId}").permitAll() + .requestMatchers(GET, "/posts/{postId}/comments").permitAll() + .requestMatchers(GET, "/posts/{postId}/comments/{commentId}").permitAll() + .requestMatchers(GET, "/cocktails/{cocktailId}/comments").permitAll() + .requestMatchers(GET, "/cocktails/{cocktailId}/comments/{cocktailCommentId}").permitAll() + .requestMatchers(GET, "/category").permitAll() + + // 나머지 모든 API는 인증 필요 + .anyRequest().authenticated() // 회원 or 인증된 사용자만 가능