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

the requested methods have been implemented #730

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

Conversation

mate-academy-student-2023

No description provided.

Comment on lines 4 to 6
private static final String BOB_EMAIL = "[email protected]";
private static final String BOB_PASSWORD = "querty";
private static final String DEFAULT_PASSWORD = "1234";

Choose a reason for hiding this comment

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

useless constants

Suggested change
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)) {

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!
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.

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();

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

Suggested change
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));
Copy link

Choose a reason for hiding this comment

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

Suggested change
return (user != null && user.getPassword().equals(password));
return user != null && user.getPassword().equals(password);

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