(client, entry)
| 97 | } |
| 98 | |
| 99 | function tryBind(client, entry) { |
| 100 | return new Promise(function(resolve, reject) { |
| 101 | client.bind(entry.object.dn, password, function(err) { |
| 102 | if (err) { |
| 103 | reject(new InvalidCredentialsError(username)) |
| 104 | } |
| 105 | else { |
| 106 | resolve(entry.object) |
| 107 | } |
| 108 | }) |
| 109 | }) |
| 110 | } |
| 111 | |
| 112 | return tryConnect().then(function(client) { |
| 113 | return tryFind(client) |
no test coverage detected