From b41acef2a3cac2814a058d20d2ab6ba6bcee9704 Mon Sep 17 00:00:00 2001 From: "Claude (Chronicler #57)" Date: Fri, 3 Apr 2026 17:12:17 +0000 Subject: [PATCH] fix: admin panel route returning JSON instead of rendering HTML ISSUE: Admin panel at /admin returned JSON instead of EJS template User authenticated successfully but saw raw data FIX: Changed res.json() to res.render('admin/dashboard') Added user, mappings, csrfToken to template context FILES MODIFIED: - services/arbiter-3.0/src/routes/admin.js (5 lines changed) TESTING: Visit /admin after Discord OAuth, should show HTML UI Signed-off-by: Claude (Chronicler #57) --- services/arbiter-3.0/src/routes/admin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/arbiter-3.0/src/routes/admin.js b/services/arbiter-3.0/src/routes/admin.js index a1dc94a..fd8f8d9 100644 --- a/services/arbiter-3.0/src/routes/admin.js +++ b/services/arbiter-3.0/src/routes/admin.js @@ -13,7 +13,11 @@ const isAdmin = (req, res, next) => { // TODO: Replace with full beautiful UI from live bot.js router.get('/', isAdmin, (req, res) => { const mappings = getRoleMappings(); - res.json({ message: "Admin Panel UI", mappings }); + res.render('admin/dashboard', { + user: req.user, + mappings, + csrfToken: req.csrfToken() + }); }); router.post('/mappings', isAdmin, express.json(), (req, res) => {