Skip to content

Commit

Permalink
fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ykudrynska committed Jul 2, 2024
1 parent 9bf87be commit c8cbaaa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/mate/academy/service/AuthenticationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ 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 boolean login(String email, String password) {
User user = userService.findByEmail(email);
if (user != null) {
return user.getPassword().equals(password);
}
return false;
return user != null && user.getPassword().equals(password);
}
}

0 comments on commit c8cbaaa

Please sign in to comment.