fix ldapjs usage

This commit is contained in:
Girish Ramakrishnan
2016-09-26 09:08:04 -07:00
parent d39fa041bf
commit 46d8047599
+2 -2
View File
@@ -250,8 +250,8 @@ function authenticateUser(req, res, next) {
debug('user bind: %s (from %s)', req.dn.toString(), req.connection.ldap.id);
// extract the common name which might have different attribute names
var attributeName = Object.keys(req.dn.rdns[0])[0];
var commonName = req.dn.rdns[0][attributeName];
var attributeName = Object.keys(req.dn.rdns[0].attrs)[0];
var commonName = req.dn.rdns[0].attrs[attributeName].value;
if (!commonName) return next(new ldap.NoSuchObjectError(req.dn.toString()));
var api;