From ee69ff92613d4bf3a836e42232ecf455dcf48215 Mon Sep 17 00:00:00 2001 From: Alsotang Date: Fri, 20 Dec 2013 16:46:37 +0800 Subject: [PATCH] Fix auth middleware bug --- middleware/auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/auth.js b/middleware/auth.js index 33ee6bbb8..c89995882 100644 --- a/middleware/auth.js +++ b/middleware/auth.js @@ -52,7 +52,7 @@ module.exports = function (options) { } req.session.name = row.name; - if (config.admins[req.session.name]) { + if (config.admins.hasOwnProperty(req.session.name)) { req.session.isAdmin = true; } debug('auth pass user: %j, onlySync: %s, isAdmin: %s, headers: %j',