public function onUserRegister(UserRegisterEvent $event)
    {
        $masterRequest = $this
            ->requestStack
            ->getMasterRequest();

        if (!($masterRequest instanceof Request)) {
            return $this;
        }

        if (null === $this
                ->tokenStorage
                ->getToken()
        ) {
            return $this;
        }

        $token = $this->createNewToken(
            $event->getUser()
        );

        $this
            ->tokenStorage
            ->setToken($token);

        $event = new InteractiveLoginEvent(
            $masterRequest,
            $token
        );

        $this
            ->dispatcher
            ->dispatch(
                SecurityEvents::INTERACTIVE_LOGIN,
                $event
            );

        return $this;
    }