Skip to content

Commit

Permalink
Update UserService.java
Browse files Browse the repository at this point in the history
  • Loading branch information
lor6 authored Jan 24, 2019
1 parent 813d381 commit 58383b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/baeldung/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class UserService implements IUserService {

@Override
public User registerNewUserAccount(final UserDto accountDto) {
if (emailExist(accountDto.getEmail())) {
if (emailExists(accountDto.getEmail())) {
throw new UserAlreadyExistException("There is an account with that email adress: " + accountDto.getEmail());
}
final User user = new User();
Expand Down Expand Up @@ -205,7 +205,7 @@ public User updateUser2FA(boolean use2FA) {
return currentUser;
}

private boolean emailExist(final String email) {
private boolean emailExists(final String email) {
return userRepository.findByEmail(email) != null;
}

Expand Down

0 comments on commit 58383b5

Please sign in to comment.