diff --git a/user-service/src/main/java/com/waither/userservice/config/WebMvcConfig.java b/user-service/src/main/java/com/waither/userservice/config/WebMvcConfig.java index 05a952bc..fb974296 100644 --- a/user-service/src/main/java/com/waither/userservice/config/WebMvcConfig.java +++ b/user-service/src/main/java/com/waither/userservice/config/WebMvcConfig.java @@ -20,6 +20,4 @@ public void addArgumentResolvers(List resolvers) resolvers.add(authUserArgumentResolver); } - - } diff --git a/user-service/src/main/java/com/waither/userservice/global/jwt/userdetails/PrincipalDetailsService.java b/user-service/src/main/java/com/waither/userservice/global/jwt/userdetails/PrincipalDetailsService.java index 183121bb..186efcd1 100644 --- a/user-service/src/main/java/com/waither/userservice/global/jwt/userdetails/PrincipalDetailsService.java +++ b/user-service/src/main/java/com/waither/userservice/global/jwt/userdetails/PrincipalDetailsService.java @@ -26,6 +26,6 @@ public UserDetails loadUserByUsername(String email) throws UsernameNotFoundExcep User user = userEntity.get(); return new PrincipalDetails(user.getEmail(),user.getPassword(), user.getRole()); } - throw new CustomException(ErrorCode.USER_NOT_FOUND); + throw new UsernameNotFoundException("올바르지 않은 email"); } } \ No newline at end of file diff --git a/user-service/src/main/java/com/waither/userservice/global/response/ErrorCode.java b/user-service/src/main/java/com/waither/userservice/global/response/ErrorCode.java index b9e29d80..208810c9 100644 --- a/user-service/src/main/java/com/waither/userservice/global/response/ErrorCode.java +++ b/user-service/src/main/java/com/waither/userservice/global/response/ErrorCode.java @@ -39,8 +39,8 @@ public enum ErrorCode implements BaseErrorCode { UNABLE_TO_SEND_EMAIL(HttpStatus.INTERNAL_SERVER_ERROR, "EMAIL500_0", "이메일을 전송하는 도중, 에러가 발생했습니다."), NO_SUCH_ALGORITHM(HttpStatus.INTERNAL_SERVER_ERROR, "EMAIL500_1", "이메일 인증 코드를 생성할 수 없습니다."), - DATA_NOT_FOUND(HttpStatus.BAD_REQUEST, "USER404_0", "해당 데이터를 찾을 수 없습니다."), - USER_NOT_FOUND(HttpStatus.BAD_REQUEST, "USER404_1", "사용자가 없습니다."), + DATA_NOT_FOUND(HttpStatus.NOT_FOUND, "USER404_0", "해당 데이터를 찾을 수 없습니다."), + USER_NOT_FOUND(HttpStatus.NOT_FOUND, "USER404_1", "사용자가 없습니다."), EMAIL_NOT_EXIST(HttpStatus.BAD_REQUEST, "USER400_2", "이메일은 필수 입니다."), PASSWORD_NOT_EQUAL(HttpStatus.BAD_REQUEST, "USER400_3", "비밀번호가 일치하지 않습니다."), CURRENT_PASSWORD_NOT_EQUAL(HttpStatus.BAD_REQUEST, "USER400_4", "현재 비밀번호가 일치하지 않습니다."),