Add authentication check to root route - redirect to login if not authenticated

This commit is contained in:
1sonhador committed 2025-10-15 01:13:09 +01:00
1 parent f088387c5c
commit d7d6ba9391
1 file changed
+10 -1
+10 -1
View File
@@ -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