Skip to content

Commit

Permalink
fix user in login method
Browse files Browse the repository at this point in the history
  • Loading branch information
skotsurskiy committed Aug 21, 2024
1 parent de5e8ac commit 9b55319
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/mate/academy/service/AuthenticationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public class AuthenticationService {
private UserService userService = new UserService();

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

0 comments on commit 9b55319

Please sign in to comment.