Skip to content

Commit

Permalink
[refactor] logout 성공 handling 변경 #46
Browse files Browse the repository at this point in the history
[refactor] logout 성공 handling 변경
  • Loading branch information
yangchef1 authored May 22, 2024
2 parents 4643c90 + 0c094da commit 7d46db1
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.authentication.logout.HttpStatusReturningLogoutSuccessHandler;
import org.springframework.web.cors.CorsConfiguration;

import java.util.Arrays;
Expand Down Expand Up @@ -75,6 +76,10 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
//http basic 인증 방식 disable
.httpBasic(AbstractHttpConfigurer::disable)

// logout
.logout((logout) -> logout
.logoutSuccessHandler(new HttpStatusReturningLogoutSuccessHandler()))

//경로별 인가 작업
.authorizeHttpRequests((auth) -> auth
.requestMatchers("/signup", "/login", "/checkUserName/{username}", "/image/{fileName}").permitAll()
Expand Down

0 comments on commit 7d46db1

Please sign in to comment.