【发布时间】:2019-01-02 03:02:09
【问题描述】:
使用apache/couchdb:2 泊坞窗图像。我在 couchdb (bloggs) 和数据库 (notes) 中添加了一个用户,并使用 Fauxton 将用户添加到了数据库中。
然后使用我尝试过的 pouchdb-authentication:
var db = new PouchDB('http://couchdb.korea.lan:5984/notes', {skip_setup: true});
db.logIn('bloggs', 'mypassword').then(function() {
db.put(doc);
});
登录成功,此时我可以执行console.log() 或注销。但是db.put() 调用失败并返回 401:
{"error":"unauthorized","reason":"You are not authorized to access this db."}
如果我执行 db.logout(),容器日志输出会显示用户名,但 db.put() 会在用户名出现在注销时显示“未定义”。
知道我错过了什么吗?
【问题讨论】:
标签: authentication couchdb pouchdb