Class ValidPasswordValidator
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.module.web.validation.validators.ValidPasswordValidator
-
- All Implemented Interfaces:
javax.validation.ConstraintValidator<ValidPassword,java.lang.String>
public class ValidPasswordValidator extends java.lang.Object implements javax.validation.ConstraintValidator<ValidPassword,java.lang.String>
Form validator that checks if the password supplied matches that of the current user
-
-
Constructor Summary
Constructors Constructor Description ValidPasswordValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(ValidPassword constraint)
boolean
isValid(java.lang.String password, javax.validation.ConstraintValidatorContext context)
Performs the validation step by fetching the account from the repository, encoding the supplied password and checking that against the encoded password stored in the database
-
-
-
Method Detail
-
initialize
public void initialize(ValidPassword constraint)
- Specified by:
initialize
in interfacejavax.validation.ConstraintValidator<ValidPassword,java.lang.String>
-
isValid
public boolean isValid(java.lang.String password, javax.validation.ConstraintValidatorContext context)
Performs the validation step by fetching the account from the repository, encoding the supplied password and checking that against the encoded password stored in the database- Specified by:
isValid
in interfacejavax.validation.ConstraintValidator<ValidPassword,java.lang.String>
- Parameters:
password
- the plaintext password from the formcontext
- (not used here)- Returns:
- whether or not the validation passed
-
-