Class UIPasswordResetService


  • @Component
    public class UIPasswordResetService
    extends java.lang.Object
    Handles service calls for password resets.
    • 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 account
      java.lang.String createAndSendNewPasswordResetEmail​(java.lang.String usernameOrEmail, java.util.Locale locale)
      Create a password reset for the given email address or username
      java.lang.String setNewPassword​(java.lang.String resetId, java.lang.String password, org.springframework.ui.Model model, java.util.Locale locale)
      Set the password for the User
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 for
        locale - 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 the PasswordReset
        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 the User
        Parameters:
        resetId - The PasswordReset identifier
        password - The new password to set for the user
        model - A model for the page
        locale - The logged in user's locale
        Returns:
        message if successful or not
        Throws:
        UIConstraintViolationException - if any constraints are violated