Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed problem with AuthenticationService and UserService #900

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vfilimo
Copy link

@vfilimo vfilimo commented Jan 7, 2024

No description provided.

Copy link

@Ivan95kos Ivan95kos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a few comments

new User("[email protected]", "1234")
};
new User("[email protected]", "1234")};
private User foundUser;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless variable

Suggested change
private User foundUser;

return null;
for (User user : users) {
if (user.getEmail().equals(email)) {
foundUser = user;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
foundUser = user;
return user;

foundUser = user;
}
}
return foundUser;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return foundUser;
return null;

Comment on lines 19 to 24
if (userService.findByEmail(email).getEmail().equals(email)
&& userService.findByEmail(email).getPassword().equals(password)) {
return true;
} else {
return false;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant operation

Suggested change
if (userService.findByEmail(email).getEmail().equals(email)
&& userService.findByEmail(email).getPassword().equals(password)) {
return true;
} else {
return false;
}
User user = userService.findByEmail(email);
return user != null && user.getPassword().equals(password);

@vfilimo vfilimo requested a review from Ivan95kos January 8, 2024 13:34
Copy link

@olekskov olekskov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants