Class DefaultRegistrationValidator
java.lang.Object
com.broadleafcommerce.auth.user.validation.DefaultRegistrationValidator
- All Implemented Interfaces:
RegistrationValidator
- Author:
- Phillip Verheyden (phillipuniverse)
-
Constructor Summary
ConstructorDescriptionDefaultRegistrationValidator
(PasswordRequestValidator passwordValidator, AuthRegistrationProperties authRegistrationProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthRegistrationProperties
protected PasswordRequestValidator
protected String
prefixWithEntityValidationMessageKey
(String errorCode) void
validate
(UserRegistration registration, org.springframework.validation.Errors errors) protected void
validateEmailFormat
(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 Details
-
DefaultRegistrationValidator
public DefaultRegistrationValidator(PasswordRequestValidator passwordValidator, AuthRegistrationProperties authRegistrationProperties)
-
-
Method Details
-
validate
- 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
-
validateEmailFormat
protected void validateEmailFormat(UserRegistration registration, org.springframework.validation.Errors errors) -
getPasswordValidator
-
getAuthRegistrationProperties
-