fix: remove missing includes/auth.php require from metrics and suggestions

Both endpoints tried to require a non-existent includes/auth.php and call
AuthMiddleware::requireAuth() — auth is already handled by api.php before
any endpoint file runs. This caused 500 errors on /api/metrics (which
blocked agent sparklines) and /api/suggestions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 14:18:33 +00:00
parent 9623d7323a
commit 2f5e7b5a00
2 changed files with 0 additions and 4 deletions
-2
View File
@@ -1,9 +1,7 @@
<?php
// Agent metrics history — returns CPU/RAM samples for sparklines
require_once __DIR__ . '/../config.php';
require_once __DIR__ . '/../../includes/auth.php';
header('Content-Type: application/json');
AuthMiddleware::requireAuth();
$agentId = $_GET['agent_id'] ?? '';
$hours = min((int)($_GET['hours'] ?? 2), 24);
-2
View File
@@ -1,9 +1,7 @@
<?php
// Proactive suggestions endpoint — returns time-based command suggestions
require_once __DIR__ . '/../config.php';
require_once __DIR__ . '/../../includes/auth.php';
header('Content-Type: application/json');
AuthMiddleware::requireAuth();
$hour = (int)date('G');
$dow = (int)date('w'); // 0=Sun, 6=Sat