added auth lib
This commit is contained in:
parent
d4025db1e0
commit
ba25597292
|
@ -0,0 +1,12 @@
|
|||
exports.getCookie = function(opts, cb){
|
||||
var db = nano(opts.db.url);
|
||||
nano.auth(opts.username, opts.password, function(err, body, headers){
|
||||
if(err){
|
||||
cb(err);
|
||||
}else{
|
||||
if(headers && headers['set-cookie']){
|
||||
cb(null, headers['set-cookie']);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue