Browse Source

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

Yuki Takei 8 năm trước cách đây
mục cha
commit
cf3305e878
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      lib/service/passport.js

+ 1 - 1
lib/service/passport.js

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