public function checkPassword(ExecutionContextInterface $context) { if (!$this->user->checkPassword($this->encoderFactory, $this->password)) { $context->buildViolation('The specified password is invalid.')->atPath('password')->addViolation(); return false; } }
public function checkPassword(ExecutionContextInterface $context) { if (!$this->user->checkPassword($this->encoderFactory, $this->oldPassword)) { $context->buildViolation('The specified password is invalid.')->atPath('oldPassword')->addViolation(); return false; } if ($this->password != $this->repeatPassword) { $context->buildViolation('The specified passwords are not identical!')->atPath('password')->addViolation(); return false; } if (!PasswordBuilder::isPasswordStrongEnough($this->password)) { $context->buildViolation('The password must contain lowercase, uppercase letters and numbers.')->atPath('password')->addViolation(); return false; } }