2 declare(strict_types = 1);
18 use Psr\Http\Message\ResponseInterface;
19 use Psr\Http\Message\ServerRequestInterface;
40 public function logoutAction(ServerRequestInterface $request): ResponseInterface
44 $redirectUrl = $request->getParsedBody()[
'redirect'] ?? $request->getQueryParams()[
'redirect'];
45 $redirectUrl = GeneralUtility::sanitizeLocalUrl($redirectUrl);
46 if (empty($redirectUrl)) {
47 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
48 $redirectUrl = (string)$uriBuilder->buildUriFromRoute(
'login', [], $uriBuilder::ABSOLUTE_URL);
50 return new RedirectResponse(GeneralUtility::locationHeaderUrl($redirectUrl), 303);
60 trigger_error(
'LogoutController->logout() will be replaced by protected method processLogout() in TYPO3 v10.0. Do not call from other extension.', E_USER_DEPRECATED);
76 $backendFormProtection->removeSessionTokenFromRegistry();