Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gubber230 committed Sep 24, 2024
2 parents 40900ee + 6974844 commit 482d2ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/mate/academy/service/AuthenticationService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package mate.academy.service;

import mate.academy.model.User;

public class AuthenticationService {
private static final UserService userService = new UserService();
/**
Expand All @@ -13,7 +15,8 @@ public class AuthenticationService {
*/

public boolean login(String email, String password) {
return userService.findByEmail(email) != null
&& userService.findByEmail(email).getPassword().equals(password);
User user = userService.findByEmail(email);
return user != null
&& user.getPassword().equals(password);
}
}

0 comments on commit 482d2ae

Please sign in to comment.