Skip to content
Snippets Groups Projects
Commit cf2c3050 authored by Gerrit Mohrmann's avatar Gerrit Mohrmann Committed by Benni Mack
Browse files

[BUGFIX] Move redirects in extbase felogin after the events

To fire the LoginConfirmedEvent and LogoutConfirmedEvent even when
redirects are active the redirect handling are moved after the events.

Resolves: #91023
Releases: master
Change-Id: I11fd2aba206edb68426039de7dbfa6e92d79c8a7
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64165


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarSusanne Moog <look@susi.dev>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarJonas Eberle <flightvision@googlemail.com>
Reviewed-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: default avatarSusanne Moog <look@susi.dev>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent 2f6ba305
Branches
Tags
No related merge requests found
......@@ -63,6 +63,11 @@ class LoginController extends AbstractLoginFormController
*/
protected $loginType = '';
/**
* @var string
*/
protected $redirectUrl = '';
/**
* @var ServerRequestHandler
*/
......@@ -120,15 +125,11 @@ class LoginController extends AbstractLoginFormController
return;
}
$redirectUrl = $this->redirectHandler->processRedirect(
$this->redirectUrl = $this->redirectHandler->processRedirect(
$this->loginType,
$this->configuration,
$this->request->hasArgument('redirectReferrer') ? $this->request->getArgument('redirectReferrer') : ''
);
if ($redirectUrl !== '') {
$this->eventDispatcher->dispatch(new BeforeRedirectEvent($this->loginType, $redirectUrl));
$this->redirectToUri($redirectUrl);
}
}
}
......@@ -144,6 +145,7 @@ class LoginController extends AbstractLoginFormController
}
$this->handleLoginForwards();
$this->handleRedirect();
$this->eventDispatcher->dispatch(new ModifyLoginFormViewEvent($this->view));
......@@ -174,6 +176,7 @@ class LoginController extends AbstractLoginFormController
}
$this->eventDispatcher->dispatch(new LoginConfirmedEvent($this, $this->view));
$this->handleRedirect();
$this->view->assignMultiple(
[
......@@ -190,6 +193,8 @@ class LoginController extends AbstractLoginFormController
*/
public function logoutAction(int $redirectPageLogout = 0): void
{
$this->handleRedirect();
$this->view->assignMultiple(
[
'cookieWarning' => $this->showCookieWarning,
......@@ -201,6 +206,17 @@ class LoginController extends AbstractLoginFormController
);
}
/**
* Handles the redirect when $this->redirectUrl is not empty
*/
protected function handleRedirect(): void
{
if ($this->redirectUrl !== '') {
$this->eventDispatcher->dispatch(new BeforeRedirectEvent($this->loginType, $this->redirectUrl));
$this->redirectToUri($this->redirectUrl);
}
}
/**
* Handle forwards to overview and logout actions from login action
*/
......
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