SSO Update :)
This commit is contained in:
12
index.php
12
index.php
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
// Main entry point for the application
|
||||
require_once 'config/config.php';
|
||||
require_once 'middleware/AuthMiddleware.php';
|
||||
require_once 'models/AuditLogModel.php';
|
||||
|
||||
// Parse the URL - no need to remove base path since we're at document root
|
||||
$request = $_SERVER['REQUEST_URI'];
|
||||
@@ -20,6 +22,16 @@ if (!str_starts_with($requestPath, '/api/')) {
|
||||
if ($conn->connect_error) {
|
||||
die("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
|
||||
// Authenticate user via Authelia forward auth
|
||||
$authMiddleware = new AuthMiddleware($conn);
|
||||
$currentUser = $authMiddleware->authenticate();
|
||||
|
||||
// Store current user in globals for controllers
|
||||
$GLOBALS['currentUser'] = $currentUser;
|
||||
|
||||
// Initialize audit log model
|
||||
$GLOBALS['auditLog'] = new AuditLogModel($conn);
|
||||
}
|
||||
|
||||
// Simple router
|
||||
|
||||
Reference in New Issue
Block a user