Skip to content

Commit d1f2456

Browse files
committed
TASK: Make linting happy for now
1 parent 1023f8e commit d1f2456

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Classes/Controller/BackendController.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use Neos\Neos\Domain\Repository\DomainRepository;
2222
use Neos\Neos\Domain\Repository\SiteRepository;
2323
use Neos\Neos\Domain\Service\NodeTypeNameFactory;
24+
use Neos\Neos\Domain\Service\UserService;
2425
use Neos\Neos\Domain\Service\WorkspaceService;
2526
use Neos\Neos\FrontendRouting\NodeUriBuilderFactory;
2627
use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult;
@@ -105,6 +106,12 @@ class BackendController extends ActionController
105106
*/
106107
protected $userProvider;
107108

109+
/**
110+
* @Flow\Inject
111+
* @var UserService
112+
*/
113+
protected $userService;
114+
108115
/**
109116
* @Flow\Inject
110117
* @var InitialStateProviderInterface
@@ -135,6 +142,11 @@ public function indexAction(string $node = null)
135142
$contentRepository = $this->contentRepositoryRegistry->get($siteDetectionResult->contentRepositoryId);
136143

137144
$nodeAddress = $node !== null ? NodeAddress::fromJsonString($node) : null;
145+
$user = $this->userService->getCurrentUser();
146+
147+
if ($user === null) {
148+
$this->redirectToUri($this->uriBuilder->uriFor('index', [], 'Login', 'Neos.Neos'));
149+
}
138150

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

185+
// todo duplicate user logic see above $this->userService->getBackendUser() is never null here ... pass the user instead to the method?
173186
$user = $this->userProvider->getUser();
174187
if (!$user) {
175188
$this->redirectToUri($this->uriBuilder->uriFor('index', [], 'Login', 'Neos.Neos'));

packages/neos-ui/src/Containers/Drawer/UserDropDown/UserDropDown.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
* source code.
99
*/
1010
import React from 'react';
11-
// @ts-ignore
12-
import {connect} from 'react-redux';
1311

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

0 commit comments

Comments
 (0)