diff --git a/Classes/XClass/Controller/LoginController.php b/Classes/XClass/Controller/LoginController.php index 4c7ff241..3d986a23 100644 --- a/Classes/XClass/Controller/LoginController.php +++ b/Classes/XClass/Controller/LoginController.php @@ -48,10 +48,10 @@ public function loginAction(): ResponseInterface } if ($this->redirectUrl !== '') { - $this->eventDispatcher->dispatch(new BeforeRedirectEvent($this->loginType, $this->redirectUrl)); + $event = $this->eventDispatcher->dispatch(new BeforeRedirectEvent($this->loginType, $this->redirectUrl, $this->request)); $data = [ - 'redirectUrl' => $this->redirectUrl, - 'statusCode' => 301 + 'redirectUrl' => $event->getRedirectUrl(), + 'statusCode' => 303 ]; return $this->responseFactory->createResponse()->withHeader('Content-Type', 'application/json; charset=utf-8') ->withBody($this->streamFactory->createStream(json_encode($data))); @@ -96,10 +96,10 @@ public function overviewAction(bool $showLoginMessage = false): ResponseInterfac $this->eventDispatcher->dispatch(new LoginConfirmedEvent($this, $this->view)); if ($this->redirectUrl !== '') { - $this->eventDispatcher->dispatch(new BeforeRedirectEvent($this->loginType, $this->redirectUrl)); + $event = $this->eventDispatcher->dispatch(new BeforeRedirectEvent($this->loginType, $this->redirectUrl, $this->request)); $data = [ - 'redirectUrl' => $this->redirectUrl, - 'statusCode' => 301, + 'redirectUrl' => $event->getRedirectUrl(), + 'statusCode' => 303, 'status' => 'success' ]; return $this->responseFactory->createResponse()->withHeader('Content-Type', 'application/json; charset=utf-8')