private function findUserByValidToken($token)
    {
        try {
            /** @var UserInterface $user */
            $user = $this->getUserRepository()->findUserByToken($token);
            if (new \DateTime() > $user->getPasswordResetTokenExpiresAt()) {
                throw new InvalidTokenException($token);
            }

            return $user;
        } catch (NoResultException $exc) {
            throw new InvalidTokenException($token);
        }
    }