YakovL commented on issue #174:
URL: https://github.com/apache/couchdb-nano/issues/174#issuecomment-1378427726
@glynnbird unfortunately, your suggestion doesn't work for me either: like
I've mentioned, I've tried
```
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))
```
already and looking at your suggestion, I've also tried
```
const nano = nanoClient(`http://127.0.0.1:5984`)
nano.auth(config.storage.couchdb.user, config.storage.couchdb.password)
.then(() => nano.use('test_polling_storage').list().then(console.log))
```
but I'm still getting `Error: You are not authorized to access this db.`
Just to be clear, I'm using TypeScript and `nanoClient` is from `import
nanoClient from 'nano'`.
As for the "URL spec", it's actually
[URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier), and according
to [wiki schemes list](https://en.wikipedia.org/wiki/List_of_URI_schemes),
those are
RFC 1738, RFC 2616 (makes RFC 2068 obsolete), RFC 7230 for http: and
RFC 2817, RFC 7230 for https:
Looks like [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) is quite
definitive (see TOC) which basically
[sais](https://www.rfc-editor.org/rfc/rfc3986#section-3.2.1) that..
> Use of the format "user:password" in the userinfo field is deprecated
!
So, while it was a standart way to %-encode both username and password, I'm
not sure what are the deprecation reasons and whether this is the way to go.
Still, I'm getting an error for what you have suggested, so I wonder what
may be the problem.
--
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]