File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
src/main/java/com/example/log4u/common/config Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 1313import org .springframework .security .oauth2 .client .web .OAuth2LoginAuthenticationFilter ;
1414import org .springframework .security .web .SecurityFilterChain ;
1515import 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
1719import com .example .log4u .common .oauth2 .handler .OAuth2AuthenticationSuccessHandler ;
1820import 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 }))
You can’t perform that action at this time.
0 commit comments