public function recoverPassword(AbstractUser $user, $hash, $newPassword)
    {
        if ($hash == $user->getRecoveryHash()) {
            $user
                ->setPassword($newPassword)
                ->setRecoveryHash(null);
            $this->manager->flush($user);

            $this
            ->passwordEventDispatcher
            ->dispatchOnPasswordRecoverEvent($user);
        }

        return $this;
    }