Skip to content

Commit

Permalink
fix(internal): remove unnecessary login hop (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLicense committed Sep 2, 2024
1 parent ea078f0 commit 6b844f1
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions app/internal/module/Olcs/src/Controller/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit 6b844f1

Please sign in to comment.