Skip to content

Conversation

@Inna1989F
Copy link

No description provided.

Copy link

@Elena-Bruyako Elena-Bruyako 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;
UserService userService = new UserService();

Choose a reason for hiding this comment

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

suggestion

import mate.academy.model.User;

public class AuthenticationService {
/**

Choose a reason for hiding this comment

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

make UserService class-level variable to avoid creating object each time you call login method

Suggested change
/**
private final UserService userService = new UserService();
/**

return false;
UserService userService = new UserService();
User user = userService.findByEmail(email);
if (user == null) {

Choose a reason for hiding this comment

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

you can use ternary operator here

Copy link
Author

@Inna1989F Inna1989F left a comment

Choose a reason for hiding this comment

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

Fixed

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