private void validateLoginDTO(LoginDTO loginDTO) {
if (loginDTO == null)
throw new EmailOrPasswordIncorrectException();
if (loginDTO.getEmail() == null || loginDTO.getPassword() == null)
throw new EmailOrPasswordIncorrectException();
if (!emailAlreadyExist(loginDTO.getEmail()))
throw new EmailOrPasswordIncorrectException();
if (!isEmailPasswordMatch(loginDTO.getEmail(), loginDTO.getPassword()))
throw new EmailOrPasswordIncorrectException();
if (!userIsConfirmed())
throw new UnconfirmedUserException();
}
if the order of isEmailPasswordMatch with userIsConfirmed is changed, a bug may occur
if the order of
isEmailPasswordMatch
withuserIsConfirmed
is changed, a bug may occur