Browse Source

BugFix: fix getLdapConfigurationFunc doesn't returns function when 'serverUrl' is invalid

Yuki Takei 8 years ago
parent
commit
cf3305e878
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/service/passport.js

+ 1 - 1
lib/service/passport.js

@@ -170,7 +170,7 @@ class PassportService {
     const match = serverUrl.match(/(ldaps?:\/\/[^\/]+)\/(.*)?/);
     const match = serverUrl.match(/(ldaps?:\/\/[^\/]+)\/(.*)?/);
     if (match == null || match.length < 1) {
     if (match == null || match.length < 1) {
       debug('LdapStrategy: serverUrl is invalid');
       debug('LdapStrategy: serverUrl is invalid');
-      return;
+      return (req, callback) => { callback({ message: 'serverUrl is invalid'}) };
     }
     }
     const url = match[1];
     const url = match[1];
     const searchBase = match[2] || '';
     const searchBase = match[2] || '';