Skip to content

Commit

Permalink
TASK: Make linting happy for now
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Jan 15, 2025
1 parent 1023f8e commit d1f2456
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 13 additions & 0 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Neos\Neos\Domain\Repository\DomainRepository;
use Neos\Neos\Domain\Repository\SiteRepository;
use Neos\Neos\Domain\Service\NodeTypeNameFactory;
use Neos\Neos\Domain\Service\UserService;
use Neos\Neos\Domain\Service\WorkspaceService;
use Neos\Neos\FrontendRouting\NodeUriBuilderFactory;
use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult;
Expand Down Expand Up @@ -105,6 +106,12 @@ class BackendController extends ActionController
*/
protected $userProvider;

/**
* @Flow\Inject
* @var UserService
*/
protected $userService;

/**
* @Flow\Inject
* @var InitialStateProviderInterface
Expand Down Expand Up @@ -135,6 +142,11 @@ public function indexAction(string $node = null)
$contentRepository = $this->contentRepositoryRegistry->get($siteDetectionResult->contentRepositoryId);

$nodeAddress = $node !== null ? NodeAddress::fromJsonString($node) : null;
$user = $this->userService->getCurrentUser();

if ($user === null) {
$this->redirectToUri($this->uriBuilder->uriFor('index', [], 'Login', 'Neos.Neos'));
}

$this->workspaceService->createPersonalWorkspaceForUserIfMissing($siteDetectionResult->contentRepositoryId, $user);
$workspace = $this->workspaceService->getPersonalWorkspaceForUser($siteDetectionResult->contentRepositoryId, $user->getId());
Expand Down Expand Up @@ -170,6 +182,7 @@ public function indexAction(string $node = null)
$node = $subgraph->findNodeById($nodeAddress->aggregateId);
}

// todo duplicate user logic see above $this->userService->getBackendUser() is never null here ... pass the user instead to the method?
$user = $this->userProvider->getUser();
if (!$user) {
$this->redirectToUri($this->uriBuilder->uriFor('index', [], 'Login', 'Neos.Neos'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* source code.
*/
import React from 'react';
// @ts-ignore
import {connect} from 'react-redux';

import {neos} from '@neos-project/neos-ui-decorators';
import {Icon, DropDown} from '@neos-project/react-ui-components';
Expand Down

0 comments on commit d1f2456

Please sign in to comment.