Skip to content

Commit

Permalink
Merge pull request #1 from dustinsmith1024/reconnect-fix
Browse files Browse the repository at this point in the history
Reconnect fix
  • Loading branch information
Mctalian committed Jan 15, 2016
2 parents 8a056d5 + af0ec14 commit 77e024f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions lib/LdapLookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ var LdapLookup = module.exports = function(options){
'(&(objectclass=user)(|(sAMAccountName={0})(UserPrincipalName={0})))';

this._client = options.client ? options.client : ldap.createClient({
url: options.url,
maxConnections: 10,
bindDN: options.bindDN,
credentials: options.bindCredentials,
tlsOptions: options.tlsOptions
url: options.url,
maxConnections: options.maxConnections || 10,
bindDN: options.bindDN,
bindCredentials: options.bindCredentials,
tlsOptions: options.tlsOptions,
reconnect: options.reconnect
});

this._client.on('error', function(e){
Expand Down
3 changes: 3 additions & 0 deletions lib/LdapValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ LdapValidator.prototype.validate = function (username, password, callback) {

var client = this._options.binder || ldap.createClient({ url: this._options.url, tlsOptions: this._options.tlsOptions });

client.on('error', function(e){
console.log("Error in LdapValidator", e);
})
//try bind by password
client.bind(up.dn, password, function(err) {
if(err) return callback();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "passport-windowsauth",
"version": "0.5.1",
"version": "0.6.0",
"description": "Passport strategy for Windows Integrated Authentication (NTLM)",
"main": "lib/strategy.js",
"scripts": {
Expand Down

0 comments on commit 77e024f

Please sign in to comment.