Guest User

Untitled

a guest
Apr 9th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.post('/auth', function(req,res) {
  2.   //console.log(req.body.username + ' ... ' + req.body.password);
  3.   console.log(crypto.createHash('md5').update('133715').digest("hex"));
  4.  
  5.   var user_collection = function (err, collection) {
  6.     collection.find({user: req.body.username,pass: crypto.createHash('md5').update(req.body.password).digest("hex")}).toArray(function(err, user_results) {
  7.       console.log(user_results);
  8.       res.redirect('/');
  9.     });
  10.   };
  11.  
  12.   db.open(function(err, p_client) {
  13.     db.collection('user', user_collection);
  14.   });
  15.  
  16. });
Add Comment
Please, Sign In to add comment