Skip to content

Instantly share code, notes, and snippets.

@thebergamo
Forked from rbezerra/ad.js
Created May 31, 2016 14:16
Show Gist options
  • Save thebergamo/5789ef2be39e9c3c2722a32a614777b3 to your computer and use it in GitHub Desktop.
Save thebergamo/5789ef2be39e9c3c2722a32a614777b3 to your computer and use it in GitHub Desktop.
ad.findUserAsync(login)
.then(function(user){
return ad.authenticateAsync(user.mail, password);
})
.then(function(auth){
if(!auth) res.status(403).send({"message": "user not authenticated"});
res.status(200).send({"message": "user authenticated","data": user});
})
.catch(function(err){
return next(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment