Skip to content

Commit

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

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

return user != null && user.getPassword().equals(password);
}
}

0 comments on commit 5be4abf

Please sign in to comment.