From 6b844f144aecde68634f5eda8451e1068d6c19a3 Mon Sep 17 00:00:00 2001 From: JoshuaLicense Date: Mon, 2 Sep 2024 13:42:02 +0100 Subject: [PATCH] fix(internal): remove unnecessary login hop (#299) --- .../src/Controller/Auth/LoginController.php | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/app/internal/module/Olcs/src/Controller/Auth/LoginController.php b/app/internal/module/Olcs/src/Controller/Auth/LoginController.php index 7eb0ed697c..b3cf5e5249 100644 --- a/app/internal/module/Olcs/src/Controller/Auth/LoginController.php +++ b/app/internal/module/Olcs/src/Controller/Auth/LoginController.php @@ -128,7 +128,7 @@ public function postAction(Request $request, RouteMatch $routeMatch, Response $r $result = $this->attemptAuthentication($request); if ($result->getCode() === Result::SUCCESS) { - return $this->handleSuccessfulAuthentication($result, $response, $request); + return $this->redirectHelper->toRoute(static::ROUTE_DASHBOARD); } if ($result->getCode() === static::AUTH_SUCCESS_WITH_CHALLENGE) { @@ -222,33 +222,6 @@ protected function attemptAuthentication(Request $request): Result return $result; } - /** - * Handles successful authentication. - * - * @return Response - */ - private function handleSuccessfulAuthentication(Result $result, Response $response, Request $request) - { - $identityProvider = $result->getIdentity()['provider']; - - if ($identityProvider === self::DVSA_OLCS_AUTH_CLIENT_COGNITO) { - return $this->handleSuccessCognitoResult(); - } - - return $this->redirectHelper->toRoute(static::ROUTE_AUTH_LOGIN_GET); - } - - /** - * @param array $identity - * @param Request $request - * @param Response $response - * @return Response - */ - private function handleSuccessCognitoResult() - { - return $this->redirectHelper->toRoute(static::ROUTE_DASHBOARD); - } - /** * Validate that the goto URL is valid *