Преглед изворни кода

generalized promisifiedPassportAuthentication

sou пре 8 година
родитељ
комит
a9e0158738
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      lib/routes/login-passport.js

+ 5 - 5
lib/routes/login-passport.js

@@ -82,6 +82,11 @@ module.exports = function(crowi, app) {
     const strategyName = 'ldapauth';
     const ldapAccountInfo = await promisifiedPassportAuthentication(req, res, next, strategyName);
 
+    // check groups for LDAP
+    if (!isValidLdapUserByGroupFilter(ldapAccountInfo)) {
+      return loginFailure(req, res, next);
+    }
+
     /*
       * authentication success
       */
@@ -244,11 +249,6 @@ module.exports = function(crowi, app) {
           return next();
         }
 
-        // check groups for LDAP user
-        if (!isValidLdapUserByGroupFilter(response)) {
-          return loginFailure(req, res, next);
-        }
-
         resolve(response)
       })(req, res, next);
     });