11package com .back .web7_9_codecrete_be .global .security ;
22
3+ import com .back .web7_9_codecrete_be .domain .auth .service .TokenService ;
34import lombok .RequiredArgsConstructor ;
45import org .springframework .context .annotation .Bean ;
56import org .springframework .context .annotation .Configuration ;
67import org .springframework .security .authentication .AuthenticationManager ;
78import org .springframework .security .config .Customizer ;
89import org .springframework .security .config .annotation .authentication .configuration .AuthenticationConfiguration ;
910import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
10- import org .springframework .security .crypto .bcrypt .BCryptPasswordEncoder ;
11- import org .springframework .security .crypto .password .PasswordEncoder ;
1211import org .springframework .security .web .SecurityFilterChain ;
1312import org .springframework .security .web .authentication .UsernamePasswordAuthenticationFilter ;
1413
@@ -19,6 +18,7 @@ public class SecurityConfig {
1918 private final JwtTokenProvider jwtTokenProvider ;
2019 private final JwtProperties jwtProperties ;
2120 private final CustomUserDetailService customUserDetailService ;
21+ private final TokenService tokenService ;
2222
2323 @ Bean
2424 public SecurityFilterChain securityFilterChain (HttpSecurity http ) throws Exception {
@@ -48,7 +48,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
4848 )
4949
5050 .addFilterBefore (
51- new JwtAuthenticationFilter (jwtTokenProvider , jwtProperties ),
51+ new JwtAuthenticationFilter (jwtTokenProvider , jwtProperties , tokenService ),
5252 UsernamePasswordAuthenticationFilter .class
5353 );
5454
@@ -59,9 +59,4 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
5959 public AuthenticationManager authenticationManager (AuthenticationConfiguration configuration ) throws Exception {
6060 return configuration .getAuthenticationManager ();
6161 }
62-
63- @ Bean
64- public PasswordEncoder passwordEncoder () {
65- return new BCryptPasswordEncoder ();
66- }
6762}
0 commit comments