/**
* Redirects to the Neos backend on the given site, passing a one-time login token
*
* @param Site $site
* @return 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);
}