public interface CredentialsRepository
| Modifier and Type | Method and Description |
|---|---|
void |
changeEmail(User user,
String newEmail)
Change existing user's email address.
|
void |
changePassword(User user,
String newPassword)
Change existing user's password with the new one.
|
User |
getCredentials(String email)
Find user by email address and return all details, including password.
|
User getCredentials(String email)
email - User's identifier, unique email addressEntityDoesNotExistException - if user can't be foundvoid changePassword(User user, String newPassword)
This method won't generate new password in case if given is null or empty - the exception will be thrown instead.
user - User with existing passwordnewPassword - A new password to be setEntityDoesNotExistException - if user can't be foundIllegalArgumentException - if provided user does not have correct details:
whether email or id or password is absent,
or given password is wrong for the user.
If newPassword is null or empty.void changeEmail(User user, String newEmail)
user - Existing usernewEmail - New email addressEntityAlreadyExistsException - if given email already existsEntityDoesNotExistException - if user can't be foundIllegalArgumentException - if provided user does not have correct details:
whether email or id is absent, or the new email
is null or empty