You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 14, 2024. It is now read-only.
I do subscribed to error , as per documentation error event will be fired only if any network issues or similar issues, not on successful code execution.
however I used a work around for this problem,
var isUserExist = false; // flag
//email = ddd.p@xxxxx.com
username = ddd.p
opts = {
filter: '(&(uid=' + username + ')(objectclass=posixAccount))',
attributes: ['dn', 'cn', 'mail', 'gidNumber'],
scope: 'sub'
};
client.search('dc=xxxxx,dc=com', opts, function (error, result, nxt) {
if (error) {
//err
}
result.on('searchEntry', function (entry) {
isUserExist = true; // searchEntry fired IFF match found
client.bind(entry.dn, password, function (err) {
if (err === null) {
//valid user
}
});
});
result.on(end, function(err){
if(!isUserExist){
console.log("user not found");
}
});
});
[SUB: No event is fiered when invalid UID is used (when no match found)]
Hi,
I am not able catch any event for non existing user.
For valid user I AM able to CATCH result.on('searchEntry' ,function()
I have gone through documentation but didnt found a way to do it,
Please guide me how can I handle.
p.s. : if username is valid, inside "searchEntry" I can check for valid password. but I counld find a way to capture invalid username
The text was updated successfully, but these errors were encountered: