public class DefaultRegistrationValidator extends Object implements RegistrationValidator
Constructor and Description |
---|
DefaultRegistrationValidator(PasswordRequestValidator passwordValidator,
AuthRegistrationProperties authRegistrationProperties) |
Modifier and Type | Method and 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 the
UserRegistration.getUserType() . |
public DefaultRegistrationValidator(PasswordRequestValidator passwordValidator, AuthRegistrationProperties authRegistrationProperties)
public void validate(UserRegistration registration, org.springframework.validation.Errors errors)
validate
in interface RegistrationValidator
protected void validateUserType(UserRegistration registration, org.springframework.validation.Errors errors)
UserRegistration.getUserType()
. By default, this disallows all user
types other than UserType.CUSTOMER
for security purposes. For example, we don't want
to allow someone to create a new UserType.ADMIN
user through the registration flow.registration
- the user registration to validateerrors
- the errors object on which to register validation errorsprotected void validatePasswordConfirmation(UserRegistration registration, org.springframework.validation.Errors errors)
protected String prefixWithEntityValidationMessageKey(String errorCode)
protected PasswordRequestValidator getPasswordValidator()
protected AuthRegistrationProperties getAuthRegistrationProperties()
Copyright © 2021. All rights reserved.