diff --git a/src/main/java/trothly/trothcam/service/auth/UserDetailServiceImpl.java b/src/main/java/trothly/trothcam/service/auth/UserDetailServiceImpl.java index 9cfc5f4..b71b999 100644 --- a/src/main/java/trothly/trothcam/service/auth/UserDetailServiceImpl.java +++ b/src/main/java/trothly/trothcam/service/auth/UserDetailServiceImpl.java @@ -1,6 +1,7 @@ package trothly.trothcam.service.auth; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.security.core.userdetails.UsernameNotFoundException; @@ -10,6 +11,7 @@ import static trothly.trothcam.exception.base.ErrorCode.MEMBER_NOT_FOUND; +@Slf4j @RequiredArgsConstructor @Service public class UserDetailServiceImpl implements UserDetailsService { @@ -18,7 +20,12 @@ public class UserDetailServiceImpl implements UserDetailsService { @Override public UserDetails loadUserByUsername(String memberId) throws UsernameNotFoundException { System.out.println("로그인한 memberId : " + memberId); - return (UserDetails) memberRepository.findById(Long.parseLong(memberId)) + UserDetails result = (UserDetails) memberRepository.findById(Long.parseLong(memberId)) .orElseThrow(() -> new BadRequestException(MEMBER_NOT_FOUND)); + + log.info("UserDetails: " + result.getUsername()); + log.info("UserDetails: " + result.toString()); + + return result; } }