added authentication to mongo

This commit is contained in:
Baris Usakli
2013-12-06 14:31:11 -05:00
parent f861d44d55
commit 351b07bb34
2 changed files with 11 additions and 4 deletions

View File

@@ -28,10 +28,14 @@
// TODO : what is the db user name??
/*if(nconf.get('mongo:password')) {
db.authenticate(dbUser, nconf.get('mongo:password'), function (err) {
if(nconf.get('mongo:password') && nconf.get('mongo:username')) {
db.authenticate(nconf.get('mongo:username'), nconf.get('mongo:password'), function (err) {
if(err) {
winston.error(err.message);
}
process.exit();
});
}*/
}
db.createCollection('objects', function(err, collection) {
@@ -60,7 +64,7 @@
}
});
}
})
});
callback(err);
});