From d7d6ba9391d7258e3d699a8269fe08828d6edd1e Mon Sep 17 00:00:00 2001 From: 1sonhador <1sonhador@gmail.com> Date: Wed, 15 Oct 2025 01:13:09 +0100 Subject: [PATCH] Add authentication check to root route - redirect to login if not authenticated --- crm/Routes/web.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crm/Routes/web.php b/crm/Routes/web.php index 588644d..a642dc1 100644 --- a/crm/Routes/web.php +++ b/crm/Routes/web.php @@ -55,7 +55,16 @@ foreach ($moduleFolders as $moduleName) { $router = Router::getInstance(); - +// --- HOME ROUTE --- +// Redirect to login if not authenticated, otherwise to redirects dashboard +$router->get('/', function() { + if (!\App\Core\Auth::check()) { + header('Location: /login'); + exit(); + } + header('Location: /redirects'); + exit(); +}); // --- SCANNER REDIRECTS --- // Legacy redirects for scanner compatibility