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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user