auth0 / passport-windowsauth

Windows Authentication strategy for Passport.js
MIT License
178 stars 54 forks source link

unbind client #39

Open gmcdowell opened 8 years ago

gmcdowell commented 8 years ago

Previously, successive authentication (non integrated) calls resulted in a new process being created each time which ultimately lead to an error once the stack filled up.

abaka82 commented 8 years ago

How the progress of this pull request? I have tested and the fix is working correctly. Also maybe we should put the unbind in error logic with final result like this:

    //try bind by password
    client.bind(up.dn, password, function(err) {
      if(err) {
        client.unbind(); // unbind client to remove process
        return callback();
      }
      else {
        client.unbind(); // unbind client to remove process
        callback(null, up);
      }
    }.bind(this));
jfromaniello commented 7 years ago

I merged #47 which always destroy the client, even if bind didn't success. Do we still need this change?

Thank you very much for proposing this and sorry for the delay.