Skip to content

Commit

Permalink
Added option to handle search timeLimit configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
gugan-guidanz committed Jul 4, 2022
1 parent 7e13d15 commit d5f53dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/ldapauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ LdapAuth.prototype._findUser = function (username, callback) {

var searchFilter = self.opts.searchFilter.replace(/{{username}}/g, sanitizeInput(username));
var opts = { filter: searchFilter, scope: self.opts.searchScope };

if (self.opts.timeLimit){
opts.timeLimit = self.opts.timeLimit;
}

if (self.opts.searchAttributes) {
opts.attributes = self.opts.searchAttributes;
}
Expand Down Expand Up @@ -372,6 +377,11 @@ LdapAuth.prototype._findGroups = function (user, callback) {
var searchFilter = self.opts.groupSearchFilter(user);

var opts = { filter: searchFilter, scope: self.opts.groupSearchScope };

if (self.opts.timeLimit){
opts.timeLimit = self.opts.timeLimit;
}

if (self.opts.groupSearchAttributes) {
opts.attributes = self.opts.groupSearchAttributes;
}
Expand Down

0 comments on commit d5f53dd

Please sign in to comment.