Neos\Neos\Controller\Backend\BackendController::switchSiteAction PHP Метод

switchSiteAction() публичный Метод

Redirects to the Neos backend on the given site, passing a one-time login token
public switchSiteAction ( Site $site ) : void
$site Neos\Neos\Domain\Model\Site
Результат void
    public function switchSiteAction($site)
    {
        $token = Algorithms::generateRandomToken(32);
        $this->loginTokenCache->set($token, $this->currentSession->getId());
        $siteUri = $this->linkingService->createSiteUri($this->controllerContext, $site);
        $loginUri = $this->controllerContext->getUriBuilder()->reset()->uriFor('tokenLogin', ['token' => $token], 'Login', 'Neos.Neos');
        $this->redirectToUri($siteUri . $loginUri);
    }