Class UIPasswordResetService
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.ria.web.services.UIPasswordResetService
-
@Component public class UIPasswordResetService extends java.lang.Object
Handles service calls for password resets.
-
-
Constructor Summary
Constructors Constructor Description UIPasswordResetService(UserService userService, PasswordResetService passwordResetService, EmailController emailController, org.springframework.context.MessageSource messageSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
activateAccount(java.lang.String identifier, java.util.Locale locale)
Activate the user accountjava.lang.String
createAndSendNewPasswordResetEmail(java.lang.String usernameOrEmail, java.util.Locale locale)
Create a password reset for the given email address or usernamejava.lang.String
setNewPassword(java.lang.String resetId, java.lang.String password, org.springframework.ui.Model model, java.util.Locale locale)
Set the password for theUser
-
-
-
Constructor Detail
-
UIPasswordResetService
@Autowired public UIPasswordResetService(UserService userService, PasswordResetService passwordResetService, EmailController emailController, org.springframework.context.MessageSource messageSource)
-
-
Method Detail
-
createAndSendNewPasswordResetEmail
public java.lang.String createAndSendNewPasswordResetEmail(java.lang.String usernameOrEmail, java.util.Locale locale)
Create a password reset for the given email address or username- Parameters:
usernameOrEmail
- The email address or username to create a password reset forlocale
- The logged in user's locale- Returns:
- message indicating if the password reset was successfully created or not
-
activateAccount
public java.lang.String activateAccount(java.lang.String identifier, java.util.Locale locale)
Activate the user account- Parameters:
identifier
- The ID of thePasswordReset
locale
- The logged in user's locale- Returns:
- message if successful or not
-
setNewPassword
public java.lang.String setNewPassword(java.lang.String resetId, java.lang.String password, org.springframework.ui.Model model, java.util.Locale locale) throws UIConstraintViolationException
Set the password for theUser
- Parameters:
resetId
- ThePasswordReset
identifierpassword
- The new password to set for the usermodel
- A model for the pagelocale
- The logged in user's locale- Returns:
- message if successful or not
- Throws:
UIConstraintViolationException
- if any constraints are violated
-
-