Skip to content

Conversation

@noleynik29
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

* Return false in any other cases.
*/
public boolean login(String email, String password) {
UserService userService = new UserService();

Choose a reason for hiding this comment

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

make UserService userService class-level variable

public boolean login(String email, String password) {
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.

use ternary operator here

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