From f61673f0666db514cc8ac501e269c9fdb11da1e1 Mon Sep 17 00:00:00 2001 From: jinho7 <69239293+jinho7@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:07:22 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EC=97=90=EB=9F=AC=EC=B2=98=EB=A6=AC=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/waither/userservice/config/WebMvcConfig.java | 2 -- .../global/jwt/userdetails/PrincipalDetailsService.java | 2 +- .../com/waither/userservice/global/response/ErrorCode.java | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) 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", "현재 비밀번호가 일치하지 않습니다."),