Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gubber230 committed Sep 24, 2024
1 parent 5c14ae6 commit 40900ee
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mate.academy.service;

public class AuthenticationService {
private static final UserService userService = new UserService();
/**
* Imagine that some user wants to login to your site.
* You should check if user credentials (login and password) are valid or not.
Expand All @@ -10,8 +11,8 @@ 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.
*/

public boolean login(String email, String password) {
UserService userService = new UserService();
return userService.findByEmail(email) != null
&& userService.findByEmail(email).getPassword().equals(password);
}
Expand Down

0 comments on commit 40900ee

Please sign in to comment.