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

Implemented simple authentication #1075

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

Conversation

NataBurtnyk
Copy link

No description provided.

Copy link

@okuzan okuzan left a comment

Choose a reason for hiding this comment

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

Build failed

@NataBurtnyk
Copy link
Author

Fixed

@@ -11,6 +13,15 @@ public class AuthenticationService {
* Return false in any other cases.
*/
public boolean login(String email, String password) {
UserService userService = new UserService();
Copy link

Choose a reason for hiding this comment

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

let's make UserService a private class-level field, to avoid needless recreation per each method invocation

Comment on lines 19 to 25
if (user != null) {
if (user.getPassword().equals(password)) {
return true;
}
}

return false;
Copy link

Choose a reason for hiding this comment

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

try to rewrite this solution without using true/false literals, just operation with boolean expression, return it directly

Copy link
Author

Choose a reason for hiding this comment

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

Fixed remarks

@NataBurtnyk NataBurtnyk requested a review from okuzan August 9, 2024 18:04
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.

2 participants