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 login() and findByEmail() methods #1178

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

Conversation

DZotsenko
Copy link

No description provided.

Copy link

@liliia-ponomarenko liliia-ponomarenko 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! Let’s improve your solution ;)

public boolean login(String email, String password) {
return false;
return userService.findByEmail(email) != null && userService.findByEmail(email)

Choose a reason for hiding this comment

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

Can you call the method findByEmail only once? Don’t complicate the performance of your solution ;)

@@ -10,7 +10,10 @@ 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.
*/
private static final UserService userService = new UserService();

Choose a reason for hiding this comment

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

Suggested change
private static final UserService userService = new UserService();
private final UserService userService = new UserService();

@DZotsenko
Copy link
Author

DZotsenko commented Feb 18, 2025

Would be grateful for other suggestions, if you have any)

Copy link

@JJJazl JJJazl left a comment

Choose a reason for hiding this comment

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

Great! Let's move on)

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