-
Notifications
You must be signed in to change notification settings - Fork 935
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
the requested methods have been implemented #730
base: master
Are you sure you want to change the base?
the requested methods have been implemented #730
Conversation
private static final String BOB_EMAIL = "[email protected]"; | ||
private static final String BOB_PASSWORD = "querty"; | ||
private static final String DEFAULT_PASSWORD = "1234"; |
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.
useless constants
private static final String BOB_EMAIL = "[email protected]"; | |
private static final String BOB_PASSWORD = "querty"; | |
private static final String DEFAULT_PASSWORD = "1234"; |
@@ -11,6 +15,9 @@ public class AuthenticationService { | |||
* Return false in any other cases. | |||
*/ | |||
public boolean login(String email, String password) { | |||
return false; | |||
if (BOB_EMAIL.equalsIgnoreCase(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.
You should use the UserService
here
UserService
must be a class field
Please correct the task description to make it clear what exactly you are requesting to implement. Thank you!
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 overall!
@@ -11,6 +14,8 @@ public class AuthenticationService { | |||
* Return false in any other cases. | |||
*/ | |||
public boolean login(String email, String password) { | |||
return false; | |||
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.
UserService must be a class field
UserService userService = new UserService(); |
@@ -11,6 +15,7 @@ public class AuthenticationService { | |||
* Return false in any other cases. | |||
*/ | |||
public boolean login(String email, String password) { | |||
return false; | |||
User user = userService.findByEmail(email); | |||
return (user != null && user.getPassword().equals(password)); |
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.
return (user != null && user.getPassword().equals(password)); | |
return user != null && user.getPassword().equals(password); |
No description provided.