From 728fdf6f3ced85edae99084a663497c5fee3a6a8 Mon Sep 17 00:00:00 2001 From: Mishkat Najam Date: Mon, 30 Oct 2023 17:07:15 +0000 Subject: [PATCH] Clean up authenticateOneLoginHandler --- .../src/Actor/src/Handler/AuthenticateOneLoginHandler.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/service-front/app/src/Actor/src/Handler/AuthenticateOneLoginHandler.php b/service-front/app/src/Actor/src/Handler/AuthenticateOneLoginHandler.php index f80f6bbb0c..8707ed469d 100644 --- a/service-front/app/src/Actor/src/Handler/AuthenticateOneLoginHandler.php +++ b/service-front/app/src/Actor/src/Handler/AuthenticateOneLoginHandler.php @@ -50,10 +50,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface $form = new OneLoginForm($this->getCsrfGuard($request)); if ($request->getMethod() === 'POST') { - $url = $this->urlHelper->generate(); - $uiLocale = (str_contains($url, '/cy/') ? 'cy' : 'en'); - $loginUrl = $this->urlHelper->generate('auth-redirect'); - $signInLink = $this->serverUrlHelper->generate($loginUrl); + $signInLink = $this->serverUrlHelper->generate('/auth/redirect'); + $uiLocale = (str_contains($signInLink, '/cy/') ? 'cy' : 'en'); $result = $this->authenticateOneLoginService->authenticate($uiLocale, $signInLink); $this ->getSession($request, SessionMiddleware::SESSION_ATTRIBUTE)