Skip to content

Commit

Permalink
move userService to class level
Browse files Browse the repository at this point in the history
  • Loading branch information
vladis9 committed Jun 7, 2024
1 parent 73f5f0f commit 29cd1d0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import mate.academy.model.User;

public class AuthenticationService {
UserService userService = new UserService();
/**
* Imagine that some user wants to log in to your site.
* You should check if user credentials (login and password) are valid or not.
Expand All @@ -13,7 +14,6 @@ public class AuthenticationService {
* Return false in any other cases.
*/
public boolean login(String email, String password) {
UserService userService = new UserService();
User user = userService.findByEmail(email);
return user != null && user.getPassword().equals(password);
}
Expand Down

0 comments on commit 29cd1d0

Please sign in to comment.