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) <claude@firefrostgaming.com>
This commit is contained in:
Claude (Chronicler #57)
2026-04-03 17:12:17 +00:00
parent 05676a5f86
commit b41acef2a3

View File

@@ -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) => {