Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.post('/authenticate_user', function(req, res){
- var mail = req.body.Mail;
- var password = req.body.Password;
- res.setHeader("Cache-Control", "private, no-cache, no-store, must-revalidate, max-age=0");
- var isValid=authenticate_user(mail, password);
- console.log("isValid-->"+isValid);
- res.json(isValid);
- });
- var authenticate_user=function(mail, password){
- var query = user_details.find({'Mail': mail});
- query.exec( function(err, docs){
- if (docs.length==0) {
- return false;
- }
- else{
- return(docs[0].Password==password);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement