【问题标题】:401 with pouchdb authentication on put401 与 pouchdb 身份验证放在一起
【发布时间】: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


    【解决方案1】:

    没关系,看起来像个错误。

    我只是在 CDN 上使用最新的 pouchdb 版本。从 7.0.0 回滚到 6.4.3 已修复它。

    【讨论】:

    • 谢谢你,我以为我疯了,无法在 Pouch 7.0.0 上进行身份验证
    猜你喜欢
    • 2015-12-16
    • 2015-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-20
    • 1970-01-01
    相关资源
    最近更新 更多