Skip to content

Conversation

@tsuki99
Copy link

@tsuki99 tsuki99 commented Aug 18, 2025

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;
User user = new UserService().findByEmail(email);

Choose a reason for hiding this comment

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

make UserService as a class-level variable

return false;
User user = new UserService().findByEmail(email);

return new UserService().findByEmail(email) != null

Choose a reason for hiding this comment

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

Suggested change
return new UserService().findByEmail(email) != null
return userService.findByEmail(email) != null

@tsuki99 tsuki99 requested a review from Elena-Bruyako August 18, 2025 17:31

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.

Suggested change
public class AuthenticationService {
public class AuthenticationService {
private final UserService userService = new UserService();

*/
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.

Suggested change
UserService userService = new UserService();

@tsuki99 tsuki99 requested a review from Elena-Bruyako August 19, 2025 22:21
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!

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