在验证用户的 API 中需要同时返回用户定义的对象
This commit is contained in:
parent
a57eefc93c
commit
735607d2dc
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue