Skip to content

Commit a19a8f2

Browse files
committed
chore: 로그아웃 임시로 get, post 둘다 허용
1 parent 4ba584b commit a19a8f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/com/example/log4u/common/config/SecurityConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import org.springframework.security.oauth2.client.web.OAuth2LoginAuthenticationFilter;
1414
import org.springframework.security.web.SecurityFilterChain;
1515
import org.springframework.security.web.authentication.logout.LogoutFilter;
16+
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
17+
import org.springframework.security.web.util.matcher.OrRequestMatcher;
1618

1719
import com.example.log4u.common.oauth2.handler.OAuth2AuthenticationSuccessHandler;
1820
import com.example.log4u.common.oauth2.jwt.JwtAuthenticationFilter;
@@ -69,6 +71,10 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
6971
.addFilterBefore(new JwtLogoutFilter(jwtUtil, refreshTokenRepository), LogoutFilter.class)
7072
.logout(logout ->
7173
logout.logoutUrl("/logout")
74+
.logoutRequestMatcher(new OrRequestMatcher(
75+
new AntPathRequestMatcher("/logout", "POST"),
76+
new AntPathRequestMatcher("/logout", "GET")
77+
)) // POST와 GET 요청 모두 허용
7278
.logoutSuccessHandler((request, response, authentication) -> {
7379
response.setStatus(HttpServletResponse.SC_OK);
7480
}))

0 commit comments

Comments
 (0)