public function getAfterLoginRedirectionUri(ActionRequest $actionRequest)
{
$user = $this->userService->getBackendUser();
if ($user === null) {
return null;
}
$workspaceName = $this->userService->getUserWorkspaceName();
$this->createWorkspaceAndRootNodeIfNecessary($workspaceName);
$uriBuilder = new UriBuilder();
$uriBuilder->setRequest($actionRequest);
$uriBuilder->setFormat('html');
$uriBuilder->setCreateAbsoluteUri(true);
$contentContext = $this->createContext($workspaceName);
$lastVisitedNode = $this->getLastVisitedNode($workspaceName);
if ($lastVisitedNode !== null) {
return $uriBuilder->uriFor('show', array('node' => $lastVisitedNode), 'Frontend\\Node', 'Neos.Neos');
}
return $uriBuilder->uriFor('show', array('node' => $contentContext->getCurrentSiteNode()), 'Frontend\\Node', 'Neos.Neos');
}