From 0a1f7181f7f3f5b18be1e6b9810f0761b4fd228d Mon Sep 17 00:00:00 2001 From: Mishkat Najam Date: Mon, 16 Oct 2023 15:24:11 +0100 Subject: [PATCH] One login page behind feature flag --- service-front/app/config/routes.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service-front/app/config/routes.php b/service-front/app/config/routes.php index a0f0de78b6..4b8f00eaa4 100644 --- a/service-front/app/config/routes.php +++ b/service-front/app/config/routes.php @@ -30,6 +30,7 @@ declare(strict_types=1); use Common\Middleware\Routing\ConditionalRoutingMiddleware; +use Actor\Handler\AuthoriseOneLoginHandler; use Mezzio\Application; use Mezzio\MiddlewareFactory; use Psr\Container\ContainerInterface; @@ -64,6 +65,7 @@ $actorRoutes = function (Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { $USE_OLDER_LPA_JOURNEY = 'use_older_lpa_journey'; $DELETE_LPA_FEATURE = 'delete_lpa_feature'; + $ALLOW_GOV_ONE_LOGIN = getenv('ALLOW_GOV_ONE_LOGIN'); $defaultNotFoundPage = Actor\Handler\LpaDashboardHandler::class; @@ -89,7 +91,9 @@ // User auth $app->route('/login', Actor\Handler\LoginPageHandler::class, ['GET', 'POST'], 'login'); - $app->route('/one-login', Actor\Handler\AuthoriseOneLoginHandler::class, ['GET', 'POST'], 'one-login'); + if ($ALLOW_GOV_ONE_LOGIN == 'true') { + $app->route('/one-login', Actor\Handler\AuthoriseOneLoginHandler::class, ['GET', 'POST'], 'one-login'); + } $app->get('/session-expired', Actor\Handler\ActorSessionExpiredHandler::class, 'session-expired'); $app->get('/session-check', Actor\Handler\ActorSessionCheckHandler::class, 'session-check'); $app->get('/session-refresh', Common\Handler\SessionRefreshHandler::class, 'session-refresh');