Skip to content

Commit

Permalink
renamed User object and corrected private UserService to private fina…
Browse files Browse the repository at this point in the history
…l UserService
  • Loading branch information
xli1iax committed Jul 21, 2024
1 parent b37e6a5 commit 7fdca45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/mate/academy/service/AuthenticationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ public class AuthenticationService {
* @return true if user by email exists and passed password is equal to user's password.
* Return false in any other cases.
*/
private UserService userService = new UserService();
private final UserService userService = new UserService();

public UserService getUserService() {
return userService;
}

public boolean login(String email, String password) {
User userToCheck = getUserService().findByEmail(email);
User user = getUserService().findByEmail(email);

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

0 comments on commit 7fdca45

Please sign in to comment.