fix: correct auth middleware imports in hooks metrics route
Changed authMiddleware/roleMiddleware to authenticateToken/requireAdmin to match actual exports from auth.middleware.js
This commit is contained in:
parent
f56703c46d
commit
ddc78329f0
1 changed files with 2 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ const express = require('express');
|
|||
const router = express.Router();
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { authMiddleware, roleMiddleware } = require('../middleware/auth.middleware');
|
||||
const { authenticateToken, requireAdmin } = require('../middleware/auth.middleware');
|
||||
|
||||
const METRICS_PATH = path.join(__dirname, '../../.claude/metrics/hooks-metrics.json');
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ const METRICS_PATH = path.join(__dirname, '../../.claude/metrics/hooks-metrics.j
|
|||
* GET /api/admin/hooks/metrics
|
||||
* Get current hooks metrics
|
||||
*/
|
||||
router.get('/metrics', authMiddleware, roleMiddleware(['admin']), async (req, res) => {
|
||||
router.get('/metrics', authenticateToken, requireAdmin, async (req, res) => {
|
||||
try {
|
||||
// Check if metrics file exists
|
||||
if (!fs.existsSync(METRICS_PATH)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue