Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- router.post('/memLogin', function(req, resp, next){
- var result = [];
- mongo.connect(url, function(err, db){
- assert.equal(null, err);
- var dbOutPut = db.collection('members').find({userName: req.body.userNameEntry});
- dbOutPut.forEach(function(ind, err){
- assert.equal(null, err);
- result.push(ind);
- console.log(result[0]);
- },function(){
- db.close();
- if(result[0] !== undefined){
- if(result[0].userName === req.body.userNameEntry && result[0].password === req.body.passWordEntry){
- resp.render('memLogin', {memberUse: result[0], title: 'FenixChat.com'});
- } else {
- resp.render('login', {notifier: 'Username or password was incorrect. Please try again!', title: 'FenixChat.com'});
- }
- } else {
- //alert('Username and Password, not found!');
- resp.render('login', {notifier: 'Username or password was incorrect. Please try again!', title: 'FenixChat.com'});
- }
- }
- );
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement