GitHub user carlosduclos opened an issue:
https://github.com/apache/couchdb-nano/issues/8
db.follow ignores requestDefaults
[Original issue](https://github.com/dscape/nano/issues/278)
__gr2m__
Given
a database exists at http://localhost:5984/db-with-security, which is only
accessible when signed in
an admin exists with username admin and password secret
And I run this code
```javascript
var nano = require('nano')
var db = nano({
url: 'http://localhost:5984/db-with-security',
requestDefaults: {
auth: {
user: 'admin',
pass: 'secret'
}
}
})
db.info(function (error, info) {
if (error) {
return console.log(error)
}
console.log('info ok.')
db.follow(function (error) {
if (error) {
return console.log(error)
}
console.log('follow ok.')
})
})
```
I get this error
```javascript
info ok.
[Error: Bad DB response: {"error":"unauthorized","reason":"You are not
authorized to access this db."}]
```
I've managed to add the user & pass to the CouchDB directly, so don't rely
on requestDefaults anymore. But I'd still consider this an issue, from a user
expectation perspective.
----
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---