From 702ca33daacd72a256183b5fab039ca85e0d07bb Mon Sep 17 00:00:00 2001 From: Mishkat Najam Date: Mon, 23 Oct 2023 16:58:42 +0100 Subject: [PATCH] AuthoriseOneLoginHandler sends request with en or cy --- .../app/src/Actor/src/Handler/AuthoriseOneLoginHandler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service-front/app/src/Actor/src/Handler/AuthoriseOneLoginHandler.php b/service-front/app/src/Actor/src/Handler/AuthoriseOneLoginHandler.php index e78a0b9793..327222c3b6 100644 --- a/service-front/app/src/Actor/src/Handler/AuthoriseOneLoginHandler.php +++ b/service-front/app/src/Actor/src/Handler/AuthoriseOneLoginHandler.php @@ -42,12 +42,12 @@ public function handle(ServerRequestInterface $request): ResponseInterface if ($request->getMethod() === 'POST') { $this->getLogger()->info('SUBMIT PRESSED'); - $result = $this->authoriseOneLoginService->authorise('en'); + $url = $this->urlHelper->generate(); + $uiLocale = (str_contains($url, '/cy/') ? 'cy' : 'en'); + $result = $this->authoriseOneLoginService->authorise($uiLocale); $authSessionInterface = AuthSession::fromArray($result); } - //TODO: PLUG IN EN / CY from uri? - return new HtmlResponse($this->renderer->render('actor::one-login', [ 'form' => $form, ]));