if authenticate middleware is overridden by plugin, check for req.user and return notAllowed helper otherwise

/cc @LudwikJaniuk
v1.18.x
Julian Lam 6 years ago
parent be0df46e99
commit ebabcc5e3c

@ -25,7 +25,17 @@ module.exports = function (middleware) {
req: req,
res: res,
next: function (err) {
auth.setAuthVars(req, res, function () { next(err); });
if (err) {
return next(err);
}
auth.setAuthVars(req, res, function () {
if (req.loggedIn && req.user && req.user.uid) {
return next();
}
controllers.helpers.notAllowed(req, res);
});
},
});
}

Loading…
Cancel
Save