Search in sources :

Example 1 with PasswordsDontMatchValidationError

use of org.summerb.webappboilerplate.security.ve.PasswordsDontMatchValidationError in project summerb by skarpushin.

the class UsersServiceFacadeImpl method validatePasswordReset.

protected void validatePasswordReset(PasswordReset resetPasswordRequest) throws FieldValidationException {
    ValidationContext ctx = new ValidationContext();
    validatePassword(resetPasswordRequest.getPassword(), ctx);
    if (!resetPasswordRequest.getPassword().equals(resetPasswordRequest.getNewPasswordAgain())) {
        ctx.add(new PasswordsDontMatchValidationError());
    }
    ctx.throwIfHasErrors();
}
Also used : PasswordsDontMatchValidationError(org.summerb.webappboilerplate.security.ve.PasswordsDontMatchValidationError) ValidationContext(org.summerb.validation.ValidationContext)

Aggregations

ValidationContext (org.summerb.validation.ValidationContext)1 PasswordsDontMatchValidationError (org.summerb.webappboilerplate.security.ve.PasswordsDontMatchValidationError)1