Skip to content

Commit

Permalink
🚑 Fix: jwt 관련 일부 수정 (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
win-luck committed Nov 28, 2023
1 parent c228262 commit f0e3e86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
}

0 comments on commit f0e3e86

Please sign in to comment.