Skip to content

Commit

Permalink
work branch was created, findByEmail method was implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodymyr-Romanyshyn committed Oct 23, 2023
1 parent 0bc9fe0 commit 6b3c0aa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/mate/academy/service/AuthenticationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ public class AuthenticationService {
*/
public boolean login(String email, String password) {
UserService userService = new UserService();
if (email.equals(userService.findByEmail(email)) && password.equals(userService.findByEmail(password))) {
return true;
}
return false;
User user = userService.findByEmail(email);
return user != null && user.getPassword().equals(password);
}
}

0 comments on commit 6b3c0aa

Please sign in to comment.