Skip to content

Commit

Permalink
Refactor : security deprecated 되는 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
this-is-spear committed Jan 16, 2024
1 parent 75f6c14 commit 4468da9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main/java/bankingapi/util/config/SecurityConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,16 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
http.userDetailsService(userDetailsService);
http.csrf(AbstractHttpConfigurer::disable);

http
.httpBasic(withDefaults())
.formLogin()
.successHandler((request, response, authentication) -> response.sendRedirect("/hello"))
.and()
.authorizeHttpRequests((authorize) -> authorize
http.httpBasic(withDefaults()).formLogin(withDefaults());

http.authorizeHttpRequests((authorize) -> authorize
.requestMatchers("/hello").permitAll()
.requestMatchers("/docs/index.html").permitAll()
.requestMatchers("/members/register").anonymous()
.requestMatchers("/login").anonymous()
.requestMatchers("/account/**").authenticated()
.requestMatchers("/members/**").authenticated()
);
);

return http.build();
}
Expand Down

0 comments on commit 4468da9

Please sign in to comment.