-
Notifications
You must be signed in to change notification settings - Fork 949
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final UserService userService = new UserService(); | |
private final UserService userService = new UserService(); |
Would be grateful for other suggestions, if you have any) |
There was a problem hiding this 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)
No description provided.