Commit 8e36fb12 authored by Elias Häußler's avatar Elias Häußler Committed by Richard Haeser
Browse files

[BUGFIX] Build correct redirect url when switching BE user

With the introduction of Backend url rewrites with #93048,
the generated redirect url to switch backend users was
broken. The redirect url is now created from the "main"
route using the UriBuilder.

Resolves: #93225
Related: #93048
Releases: master
Change-Id: I8ab0f9540c8b3a15789aabd947580d817d386b07
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67345

Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Richard Haeser's avatarRichard Haeser <richard@richardhaeser.com>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Richard Haeser's avatarRichard Haeser <richard@richardhaeser.com>
parent 1d2b3b7c
......@@ -18,6 +18,7 @@ namespace TYPO3\CMS\Beuser\Controller;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Backend\Authentication\Event\SwitchUserEvent;
use TYPO3\CMS\Backend\Authentication\PasswordReset;
use TYPO3\CMS\Backend\Routing\UriBuilder;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Beuser\Domain\Model\BackendUser;
use TYPO3\CMS\Beuser\Domain\Model\Demand;
......@@ -372,8 +373,11 @@ class BackendUserController extends ActionController
);
$this->eventDispatcher->dispatch($event);
$redirectUrl = 'index.php' . ($GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? '' : '?commandLI=1');
throw new ImmediateResponseException(new RedirectResponse($redirectUrl, 303), 1607271592);
$redirectUri = GeneralUtility::makeInstance(UriBuilder::class)->buildUriFromRoute(
'main',
$GLOBALS['TYPO3_CONF_VARS']['BE']['interfaces'] ? [] : ['commandLI' => '1']
);
throw new ImmediateResponseException(new RedirectResponse($redirectUri, 303), 1607271592);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment