File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -193,10 +193,14 @@ LDAP.prototype.findandbind = function(opt, fn) {
193193 if ( this . auth_connection === undefined ) {
194194 this . auth_connection = new LDAP ( this . options , function newAuthConnection ( err ) {
195195 if ( err ) return fn ( err ) ;
196- return this . authbind ( data [ 0 ] . dn , opt . password , fn ) ;
196+ return this . authbind ( data [ 0 ] . dn , opt . password , function authbindResult ( err ) {
197+ fn ( err , data [ 0 ] ) ;
198+ } ) ;
197199 } . bind ( this ) ) ;
198200 } else {
199- this . authbind ( data [ 0 ] . dn , opt . password , fn ) ;
201+ this . authbind ( data [ 0 ] . dn , opt . password , function authbindResult ( err ) {
202+ fn ( err , data [ 0 ] ) ;
203+ } ) ;
200204 }
201205 return undefined ;
202206 } . bind ( this ) ) ;
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ describe('LDAP', function() {
8989 password : 'foobarbaz'
9090 } , function ( err , data ) {
9191 assert . ifError ( err ) ;
92+ assert . equal ( data . cn , 'Charlie' ) ;
9293 done ( ) ;
9394 } ) ;
9495 } ) ;
@@ -100,6 +101,7 @@ describe('LDAP', function() {
100101 password : 'foobarbaz'
101102 } , function ( err , data ) {
102103 assert . ifError ( err ) ;
104+ assert . equal ( data . cn , 'Charlie' ) ;
103105 done ( ) ;
104106 } ) ;
105107 } ) ;
You can’t perform that action at this time.
0 commit comments