mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: add back middleware.authenticateOrGuest
This commit is contained in:
@@ -100,6 +100,12 @@ module.exports = function (middleware) {
|
|||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: Remove in v1.18.0
|
||||||
|
middleware.authenticateOrGuest = (req, res, next) => {
|
||||||
|
winston.warn(`[middleware] middleware.authenticateOrGuest has been renamed, use middleware.authenticateRequest instead. (request path: ${req.path})`);
|
||||||
|
middleware.authenticateRequest(req, res, next);
|
||||||
|
};
|
||||||
|
|
||||||
middleware.ensureSelfOrGlobalPrivilege = helpers.try(async (req, res, next) => {
|
middleware.ensureSelfOrGlobalPrivilege = helpers.try(async (req, res, next) => {
|
||||||
await ensureSelfOrMethod(user.isAdminOrGlobalMod, req, res, next);
|
await ensureSelfOrMethod(user.isAdminOrGlobalMod, req, res, next);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user