diff --git a/src/main/java/mate/academy/service/AuthenticationService.java b/src/main/java/mate/academy/service/AuthenticationService.java index a6bee4027..ec6f0a09a 100644 --- a/src/main/java/mate/academy/service/AuthenticationService.java +++ b/src/main/java/mate/academy/service/AuthenticationService.java @@ -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); + } }