Class DefaultRegistrationValidator
- java.lang.Object
-
- com.broadleafcommerce.auth.user.validation.DefaultRegistrationValidator
-
- All Implemented Interfaces:
RegistrationValidator
public class DefaultRegistrationValidator extends Object implements RegistrationValidator
- Author:
- Phillip Verheyden (phillipuniverse)
-
-
Constructor Summary
Constructors Constructor Description DefaultRegistrationValidator(PasswordRequestValidator passwordValidator, AuthRegistrationProperties authRegistrationProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AuthRegistrationPropertiesgetAuthRegistrationProperties()protected PasswordRequestValidatorgetPasswordValidator()protected StringprefixWithEntityValidationMessageKey(String errorCode)voidvalidate(UserRegistration registration, org.springframework.validation.Errors errors)protected voidvalidatePasswordConfirmation(UserRegistration registration, org.springframework.validation.Errors errors)protected voidvalidateUserType(UserRegistration registration, org.springframework.validation.Errors errors)Validate theUserRegistration.getUserType().
-
-
-
Constructor Detail
-
DefaultRegistrationValidator
public DefaultRegistrationValidator(PasswordRequestValidator passwordValidator, AuthRegistrationProperties authRegistrationProperties)
-
-
Method Detail
-
validate
public void validate(UserRegistration registration, org.springframework.validation.Errors errors)
- Specified by:
validatein interfaceRegistrationValidator
-
validateUserType
protected void validateUserType(UserRegistration registration, org.springframework.validation.Errors errors)
Validate theUserRegistration.getUserType(). By default, this disallows all user types other thanUserType.CUSTOMERfor security purposes. For example, we don't want to allow someone to create a newUserType.ADMINuser through the registration flow.- Parameters:
registration- the user registration to validateerrors- the errors object on which to register validation errors
-
validatePasswordConfirmation
protected void validatePasswordConfirmation(UserRegistration registration, org.springframework.validation.Errors errors)
-
prefixWithEntityValidationMessageKey
protected String prefixWithEntityValidationMessageKey(String errorCode)
-
getPasswordValidator
protected PasswordRequestValidator getPasswordValidator()
-
getAuthRegistrationProperties
protected AuthRegistrationProperties getAuthRegistrationProperties()
-
-