feat(arbiter): Add localhost bypass for admin routes debugging
This commit is contained in:
committed by
Claude
parent
b639f92da6
commit
04bc2e734f
@@ -1,4 +1,12 @@
|
||||
function requireTrinityAccess(req, res, next) {
|
||||
// Allow localhost requests (for curl debugging from Command Center)
|
||||
const ip = req.ip || req.connection.remoteAddress;
|
||||
if (ip === '127.0.0.1' || ip === '::1' || ip === '::ffff:127.0.0.1') {
|
||||
res.locals.adminUser = { username: 'localhost', id: 'localhost' };
|
||||
res.locals.currentPath = req.path;
|
||||
return next();
|
||||
}
|
||||
|
||||
if (!req.isAuthenticated()) {
|
||||
return res.redirect('/auth/discord');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user