updated revoke session middleware to allow self or admin or global mod invocation, tweaked tests a bit

This commit is contained in:
Julian Lam
2016-12-02 10:50:42 -05:00
parent aad9a39f02
commit 33ff5e09bb
5 changed files with 14 additions and 9 deletions

View File

@@ -13,13 +13,9 @@ sessionController.revoke = function (req, res, next) {
}
var _id;
var uid;
var uid = res.locals.uid;
async.waterfall([
function (next) {
user.getUidByUserslug(req.params.userslug, next);
},
function (_uid, next) {
uid = _uid;
if (!uid) {
return next(new Error('[[error:no-session-found]]'));
}