From 735607d2dce8fbb42ef6ca57cd0b785176b2629a Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Thu, 10 Nov 2022 23:25:08 -0500 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E9=AA=8C=E8=AF=81=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=9A=84=20API=20=E4=B8=AD=E9=9C=80=E8=A6=81=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=94=A8=E6=88=B7=E5=AE=9A=E4=B9=89=E7=9A=84?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../visatrack/api/service/impl/UserService.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/northtecom/visatrack/api/service/impl/UserService.java b/src/main/java/com/northtecom/visatrack/api/service/impl/UserService.java index f45683e..eec96be 100644 --- a/src/main/java/com/northtecom/visatrack/api/service/impl/UserService.java +++ b/src/main/java/com/northtecom/visatrack/api/service/impl/UserService.java @@ -160,15 +160,15 @@ public class UserService implements UserDetailsService { User user = userRepository.findByUserEmail(username).orElseThrow(() -> new UsernameNotFoundException("User " + "not found")); + UserLoginResponse userLoginResponse = new UserLoginResponse(); + userLoginResponse.setUserId(user.getId()); + if (user.getUserStatus() == UserStatus.NEEDVERIFY) { - throw new BaseException(Status.USER_NOT_ACTIVE, "User is not verified"); + throw new BaseException(Status.USER_NOT_ACTIVE, userLoginResponse); } if (!user.getIsEmailVerified()) { - UserLoginResponse userLoginResponse = new UserLoginResponse(); - userLoginResponse.setUserId(user.getId()); -// userLoginResponse.setEmail(); - throw new BaseException(Status.USER_NOT_ACTIVE, user); + throw new BaseException(Status.USER_NOT_ACTIVE, userLoginResponse); } return new VisaTrackUserDetail(user);