diff --git a/src/main/java/com/diareat/diareat/auth/component/JwtTokenProvider.java b/src/main/java/com/diareat/diareat/auth/component/JwtTokenProvider.java index eed48e3..cbaa13d 100644 --- a/src/main/java/com/diareat/diareat/auth/component/JwtTokenProvider.java +++ b/src/main/java/com/diareat/diareat/auth/component/JwtTokenProvider.java @@ -67,6 +67,6 @@ public boolean validateToken(String jwtToken) { // Request의 Header에서 token 값 가져오기 public String resolveToken(HttpServletRequest request) { - return request.getHeader("X-AUTH-TOKEN"); + return request.getHeader("accessToken"); } } diff --git a/src/main/java/com/diareat/diareat/auth/service/CustomUserDetailService.java b/src/main/java/com/diareat/diareat/auth/service/CustomUserDetailService.java index 622e09f..f74e6fd 100644 --- a/src/main/java/com/diareat/diareat/auth/service/CustomUserDetailService.java +++ b/src/main/java/com/diareat/diareat/auth/service/CustomUserDetailService.java @@ -15,8 +15,8 @@ public class CustomUserDetailService implements UserDetailsService { private final UserRepository userRepository; @Override - public UserDetails loadUserByUsername(String keyCode) throws UsernameNotFoundException { - return userRepository.findByKeyCode(keyCode) + public UserDetails loadUserByUsername(String id) throws UsernameNotFoundException { + return userRepository.findById(Long.parseLong(id)) .orElseThrow(() -> new UsernameNotFoundException(ResponseCode.USER_NOT_FOUND.getMessage())); } }