diff --git a/lib/cb.js b/lib/cb.js index f1c29a3..2010899 100644 --- a/lib/cb.js +++ b/lib/cb.js @@ -26,11 +26,11 @@ exports.initialize = function initializeDataSource(dataSource, callback) { return; } var s = dataSource.settings; - var options = { dsconnector: s.connector, host: s.host || 'localhost', port: s.port || 8091, + user: s.user || '', password : s.password || '', n1qlport: s.n1qlport || 8093, bucket: s.database || 'default', @@ -81,6 +81,7 @@ CouchbaseDB.prototype.connect = function (callback) { }); } else { self.myCluster = new couchbase.Cluster(self.settings.connectUrl); + self.myCluster.authenticate(self.settings.user, self.settings.password); callback && callback(null, self.db); } }; @@ -530,4 +531,4 @@ CouchbaseDB.prototype.query = function (sql, callback) { var self = this; callback(null,null); -}; \ No newline at end of file +};