Skip to content

Commit

Permalink
Merge pull request #18 from pluswerk/bugfix/fix-user-info
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanti authored Aug 18, 2023
2 parents dc01ab6 + 3aba9a2 commit b458e09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/Service/ScopeConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ protected function getUserContext(): array

if ($applicationType === 'frontend') {
$username = GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('frontend.user', 'username');
$userAuthentication = $GLOBALS['TSFE']->fe_user;
$userAuthentication = ($GLOBALS['TSFE'] ?? null)?->fe_user;
}

if ($applicationType !== 'cli' && !$username) {
$username = GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('backend.user', 'username');
$userAuthentication = $GLOBALS['BE_USER'];
$userAuthentication = $GLOBALS['BE_USER'] ?? null;
}

$user = [];
Expand Down

0 comments on commit b458e09

Please sign in to comment.