我无法将会话正确传递给 CouchDB。这是我的代码:
var nano = require('nano')({
'url': 'http://myip:5984'
});
var conf = require('./conf');
nano.auth(conf.user.name, conf.user.password, function (err, body, headers) {
if (err) {
return callback(err);
}
if (headers && headers['set-cookie']) {
var nano = require('nano')({
'url':'http://myip:5984',
'cookie': headers['set-cookie']
});
}
});
但是当我打电话时,我总是收到以下消息:
Error: Bad DB response: {"error":"unauthorized","reason":"You are not authorized to access this db."}