From 2426b77f6c10d9b0106bdc44de0a4f1b7da3eeb7 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sun, 31 Aug 2025 13:33:03 -0600 Subject: [PATCH] AAA --- index.js | 5 +---- uhppoted.js | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 73cbb5d..e94e944 100644 --- a/index.js +++ b/index.js @@ -44,10 +44,7 @@ global.comparePassword = async function(password, hash) { return await bcrypt.compare(password, hash); }; -global.checkACL = function(req,, perm) { - if (!req.session.user) { - return res.status(401).render('error', { error: 'You must be logged in to access this resource.' }); - } +global.checkACL = function(req, perm) { const perms = req.session.user.perms ? JSON.parse(req.session.user.perms) : []; if (perms.includes('*') || perms.includes(perm)) { return true; diff --git a/uhppoted.js b/uhppoted.js index a3ecccd..0cad416 100644 --- a/uhppoted.js +++ b/uhppoted.js @@ -30,4 +30,4 @@ console.log('Local IP address:', localIP); uhppoted.setListener(ctx, 423163924, localIP, 60001, 1); uhppoted.listen(ctx, (msg) => { console.log(msg) -}) \ No newline at end of file +})