Skip to content

Commit

Permalink
Fixed problems indicated by the mentor. Simplified return to one line
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmartial committed Oct 27, 2023
1 parent f63dbd9 commit 0bd9991
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/java/mate/academy/service/AuthenticationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ public class AuthenticationService {
private final UserService service = new UserService();

public boolean login(String email, String password) {

User user = service.findByEmail(email);
if (user != null) {
return user.getPassword().equals(password);
}
return false;
}
return user != null && user.getPassword().equals(password);
}
}

0 comments on commit 0bd9991

Please sign in to comment.