Skip to content

Commit

Permalink
added fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazar1106 committed Sep 14, 2024
1 parent 954f6d8 commit a28f37f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ public class AuthenticationService {
private final UserService userService = new UserService();

public boolean login(String email, String password) {

User user = userService.findByEmail(email);

if (user == null) {
return false;
}
return user.getEmail().equals(email) && user.getPassword().equals(password);
return user != null && user.getEmail().equals(email) && user.getPassword().equals(password);
}
}
2 changes: 1 addition & 1 deletion src/main/java/mate/academy/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import mate.academy.model.User;

public class UserService {
private static final User[] users = new User[]{
private static final User[] users = new User[] {
new User("[email protected]", "1234"),
new User("[email protected]", "1234")};

Expand Down

0 comments on commit a28f37f

Please sign in to comment.