Skip to content

Commit

Permalink
순환 의존성 오류 해결
Browse files Browse the repository at this point in the history
JWT,시큐리티,userService 파일이 서로를 의존하고 있어 순환 의존성을 끊어 문제를 해결함
  • Loading branch information
duhwan05 committed Aug 8, 2024
1 parent 907d3e9 commit cd798e2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.example.healthylife.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
@Configuration
public class PasswordEncoderConfig {

//비밀번호 암호화 작업
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ protected void configure(HttpSecurity http) throws Exception {
.addFilterBefore(new JwtAuthenticationFilter(jwtUtil), UsernamePasswordAuthenticationFilter.class);
}

//비밀번호 암호화 작업
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}

//AuthenticationManager를 빈으로 등록하게 해서 시큐리티가 인증 매니저를 할수 있게 한다.
@Bean
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.example.healthylife.repository.UserRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down

0 comments on commit cd798e2

Please sign in to comment.