-
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
Authentification service branch #1067
base: master
Are you sure you want to change the base?
Changes from 5 commits
1c10ef6
eb0dac0
7deefef
8f15ec6
b37e6a5
7fdca45
9c4cf1e
41ba5ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,5 +1,7 @@ | ||||||||
package mate.academy.service; | ||||||||
|
||||||||
import mate.academy.model.User; | ||||||||
|
||||||||
public class AuthenticationService { | ||||||||
/** | ||||||||
* Imagine that some user wants to login to your site. | ||||||||
|
@@ -10,7 +12,15 @@ public class AuthenticationService { | |||||||
* @return true if user by email exists and passed password is equal to user's password. | ||||||||
* Return false in any other cases. | ||||||||
*/ | ||||||||
private UserService userService = new UserService(); | ||||||||
|
||||||||
public UserService getUserService() { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you need this get method? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to get the variable, Intellij IDEA indicated that it is better to make UserService object private and to get it I created the get method There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not all advice from Idea should be implemented There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove this get method |
||||||||
return userService; | ||||||||
} | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
public boolean login(String email, String password) { | ||||||||
return false; | ||||||||
User userToCheck = getUserService().findByEmail(email); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
return userToCheck != null && userToCheck.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.