mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
fix: broken test
This commit is contained in:
@@ -113,7 +113,7 @@ middleware.checkPrivileges = helpers.try(async (req, res, next) => {
|
|||||||
const path = req.path.replace(/^(\/api)?\/admin\/?/g, '');
|
const path = req.path.replace(/^(\/api)?\/admin\/?/g, '');
|
||||||
if (path) {
|
if (path) {
|
||||||
const privilege = privileges.admin.resolve(path);
|
const privilege = privileges.admin.resolve(path);
|
||||||
if (!privilege || !await privileges.admin.can(privilege, req.uid)) {
|
if (!await privileges.admin.can(privilege, req.uid)) {
|
||||||
return controllers.helpers.notAllowed(req, res);
|
return controllers.helpers.notAllowed(req, res);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -132,7 +132,6 @@ middleware.checkPrivileges = helpers.try(async (req, res, next) => {
|
|||||||
const timeLeft = parseInt(loginTime, 10) - (Date.now() - adminReloginDuration);
|
const timeLeft = parseInt(loginTime, 10) - (Date.now() - adminReloginDuration);
|
||||||
if (req.session.meta && timeLeft < Math.min(300000, adminReloginDuration)) {
|
if (req.session.meta && timeLeft < Math.min(300000, adminReloginDuration)) {
|
||||||
req.session.meta.datetime += Math.min(300000, adminReloginDuration);
|
req.session.meta.datetime += Math.min(300000, adminReloginDuration);
|
||||||
console.log('dateitme updated, now', req.session.meta.datetime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return next();
|
return next();
|
||||||
|
|||||||
Reference in New Issue
Block a user