From 988e0652cf77b525f3c5024dadc8664732508f73 Mon Sep 17 00:00:00 2001 From: Facundo Ferrero Date: Mon, 16 Jul 2018 23:46:07 -0300 Subject: [PATCH] Update cb.js Added authentication in newer version of couchbase (Enterprise Edition 5.1.1 build 5723) --- lib/cb.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 +};