mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:13:31 +02:00
Add UI to LDAP login.
This commit is contained in:
@@ -25,14 +25,19 @@ module.exports.login = function(options, username, password) {
|
||||
, maxConnections: 1
|
||||
})
|
||||
|
||||
client.bind(options.bind.dn, options.bind.credentials, function(err) {
|
||||
if (err) {
|
||||
resolver.reject(err)
|
||||
}
|
||||
else {
|
||||
resolver.resolve(client)
|
||||
}
|
||||
})
|
||||
if (options.bind.dn) {
|
||||
client.bind(options.bind.dn, options.bind.credentials, function(err) {
|
||||
if (err) {
|
||||
resolver.reject(err)
|
||||
}
|
||||
else {
|
||||
resolver.resolve(client)
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
resolver.resolve(client)
|
||||
}
|
||||
|
||||
return resolver.promise
|
||||
}
|
||||
@@ -48,7 +53,7 @@ module.exports.login = function(options, username, password) {
|
||||
, value: options.search.objectClass
|
||||
})
|
||||
, new ldap.EqualityFilter({
|
||||
attribute: options.search.loginField
|
||||
attribute: options.search.field
|
||||
, value: username
|
||||
})
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user