Add authentication check to root route - redirect to login if not authenticated
This commit is contained in:
1 parent
f088387c5c
commit
d7d6ba9391
1 file changed
+10
-1
+10
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user