Skip to content

Commit

Permalink
Update src/main/java/mate/academy/service/AuthenticationService.java
Browse files Browse the repository at this point in the history
Co-authored-by: Olena Bruiako <[email protected]>
  • Loading branch information
gubber230 and Elena-Bruyako authored Sep 24, 2024
1 parent 5c14ae6 commit 6974844
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/mate/academy/service/AuthenticationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public class AuthenticationService {
*/
public boolean login(String email, String password) {
UserService userService = new UserService();
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 6974844

Please sign in to comment.