YakovL commented on issue #174:
URL: https://github.com/apache/couchdb-nano/issues/174#issuecomment-1377152338
Hm, for me, only the approach suggested by sl45sms worked:
```
const nano = nanoClient({
url: `http://127.0.0.1:5984`,
requestDefaults: {
headers: {
// works, but insecure:
https://github.com/apache/couchdb-nano/issues/174#issuecomment-1021215664
Authorization: "Basic " + new
Buffer(`${config.storage.couchdb.user}:${config.storage.couchdb.password}`).toString('base64'),
},
},
})
nano.use('test_polling_storage').list().then(console.log)
```
while these 2 give `Error: You are not authorized to access this db.`:
```
const nano = nanoClient({
url: `http://127.0.0.1:5984`,
requestDefaults: {
headers: {
auth: {
username: config.storage.couchdb.user,
password: config.storage.couchdb.password,
},
},
},
})
nano.use('test_polling_storage').list().then(console.log)
```
and
```
const nano = nanoClient({
url: `http://127.0.0.1:5984`,
requestDefaults: {
jar: true,
},
})
nano.auth(config.storage.couchdb.user, config.storage.couchdb.password)
.then(() => nano.use('test_polling_storage').list().then(console.log))
```
@LyteFM any ideas why?
I have
* nano v10.1.0
* CouchDB v3.2.2
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]