mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
closes #2304
This commit is contained in:
@@ -14,7 +14,7 @@ var controllers = {
|
||||
|
||||
module.exports = function (middleware) {
|
||||
middleware.authenticate = function (req, res, next) {
|
||||
if (req.uid) {
|
||||
if (req.loggedIn) {
|
||||
return next();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ module.exports = function (middleware) {
|
||||
*/
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
if (!req.uid) {
|
||||
if (!req.loggedIn) {
|
||||
return setImmediate(next, null, false);
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ module.exports = function (middleware) {
|
||||
}
|
||||
|
||||
middleware.checkGlobalPrivacySettings = function (req, res, next) {
|
||||
if (!req.uid && !!parseInt(meta.config.privateUserInfo, 10)) {
|
||||
if (!req.loggedIn && !!parseInt(meta.config.privateUserInfo, 10)) {
|
||||
return middleware.authenticate(req, res, next);
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ module.exports = function (middleware) {
|
||||
};
|
||||
|
||||
middleware.requireUser = function (req, res, next) {
|
||||
if (req.uid) {
|
||||
if (req.loggedIn) {
|
||||
return next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user