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 AuthRegistrationProperties
getAuthRegistrationProperties()
protected PasswordRequestValidator
getPasswordValidator()
protected String
prefixWithEntityValidationMessageKey(String errorCode)
void
validate(UserRegistration registration, org.springframework.validation.Errors errors)
protected void
validatePasswordConfirmation(UserRegistration registration, org.springframework.validation.Errors errors)
protected void
validateUserType(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:
validate
in interfaceRegistrationValidator
-
validateUserType
protected void validateUserType(UserRegistration registration, org.springframework.validation.Errors errors)
Validate theUserRegistration.getUserType()
. By default, this disallows all user types other thanUserType.CUSTOMER
for security purposes. For example, we don't want to allow someone to create a newUserType.ADMIN
user 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()
-
-