Comparing version 1.7.0 to 1.7.1
@@ -264,3 +264,3 @@ module.exports = Cloudant; | ||
} | ||
done(null, b); | ||
done(e, b); | ||
}); | ||
@@ -273,3 +273,3 @@ } else { | ||
nano.session(function(e, b, h) { | ||
done(null, b); | ||
done(e, b); | ||
}); | ||
@@ -279,3 +279,3 @@ }, | ||
nano.relax({db:''}, function(e, b, h) { | ||
done(null, b); | ||
done(e, b); | ||
}) | ||
@@ -286,3 +286,3 @@ } | ||
body.userCtx = (data && data[1] && data[1].userCtx) || {}; | ||
callback(null, body, cookie); | ||
callback(err, body, cookie); | ||
}); | ||
@@ -289,0 +289,0 @@ } |
@@ -7,3 +7,3 @@ { | ||
"repository": "git://github.com/cloudant/nodejs-cloudant", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"author": "Jason Smith <jasons@us.ibm.com>", | ||
@@ -10,0 +10,0 @@ "contributors": [ |
@@ -74,2 +74,13 @@ /** | ||
it('should detect missing cloudant', function(done) { | ||
var mocks = nock(SERVER) | ||
.get('/_session').reply(500, {}); | ||
Cloudant({account:ME}, function(er, cloudant, body) { | ||
er.should.be.an.Object | ||
mocks.done(); | ||
done(); | ||
}); | ||
}); | ||
it('uses cookie auth for ping callback', function(done) { | ||
@@ -76,0 +87,0 @@ var mocks = nock(SERVER) |
@@ -230,9 +230,6 @@ /** | ||
var mocks = nock(SERVER) | ||
.post('/_session', {name: ME, password: PASSWORD}).reply(200, { ok: true, info: { }, userCtx: { name: ME, roles: ['_admin']}}, { 'Set-Cookie': 'AuthSession=xyz; Version=1; Path=/; HttpOnly' }) | ||
.get('/_session').reply(200, { ok: true, info: { }, userCtx: { name: ME, roles: ['_admin']}}) | ||
.get('*').reply(200, {"couchdb":"Welcome","version":"2.0.0","vendor":{"name":"IBM Cloudant","version":"5662","variant":"paas"},"features":["geo"]}) | ||
.post('/_session').reply(403, { ok: false}) | ||
var cloudant = Cloudant({plugin:'cookieauth', account:ME, password: PASSWORD}, function(err, data) { | ||
assert.equal(err, null); | ||
data.should.be.an.Object; | ||
data.should.have.property.userCtx; | ||
err.should.be.an.Object; | ||
assert.equal(mocks.isDone(), true); | ||
done(); | ||
@@ -244,8 +241,6 @@ }); | ||
var mocks = nock(SERVER) | ||
.get('/_session').reply(200, { ok: true, info: { }, userCtx: { name: ME, roles: ['_admin']}}) | ||
.get('*').reply(200, {"couchdb":"Welcome","version":"2.0.0","vendor":{"name":"IBM Cloudant","version":"5662","variant":"paas"},"features":["geo"]}) | ||
var cloudant = Cloudant({plugin:'cookieauth', url: SERVER}, function(err, data) { | ||
assert.equal(err, null); | ||
data.should.be.an.Object; | ||
data.should.have.property.userCtx; | ||
.get('/_session').reply(403, { ok: false}) | ||
var cloudant = Cloudant({plugin:'cookieauth', url: SERVER}, function(err, data) { | ||
err.should.be.an.Object; | ||
assert.equal(mocks.isDone(), true); | ||
done(); | ||
@@ -252,0 +247,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2625
152699