Skip to content

Commit

Permalink
Merge branch 'hm-2-solution' of github.com:SIPervii/jv-oop-lesson-0 i…
Browse files Browse the repository at this point in the history
…nto hm-2-solution

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
# Delete comment
  • Loading branch information
Drive999 committed Oct 9, 2024
1 parent 9e73bcc commit 3142704
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
10 changes: 0 additions & 10 deletions src/main/java/mate/academy/service/AuthenticationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@
public class AuthenticationService {
private 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.
* All users are stored in <code>UserService</code> class.
*
* @param email - user's email
* @param password - user's password
* @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) {
User user = userService.findByEmail(email);
return user != null && user.getPassword().equals(password);
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/mate/academy/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ public class UserService {
new User("[email protected]", "1234")
};

/**
* Find user by email. All users are stored in <code>private static final User[] users</code>
*
* @param email - the input parameter
* @return - user if his email is equal to passed email.
* Return <code>null</code> if there is no suitable user
*/
public User findByEmail(String email) {
for (User user : users) {
if (user.getEmail().equals(email)) {
Expand Down

0 comments on commit 3142704

Please sign in to comment.