pouchdb-community/pouchdb-authentication

"skipSetup: true" with "require_valid_user = true" shows browser modal

Open

#61 opened on Dec 16, 2015

View on GitHub
 (45 comments) (0 reactions) (0 assignees)JavaScript (115 forks)github user discovery
help wanted

Repository metrics

Stars
 (780 stars)
PR merge metrics
 (PR metrics pending)

Description

Hey there, I set require_valid_user = true in my CouchDB's local.ini, to only allow actual users, but no anonymous users.

Also skipSetup: true is set when initalizing the DB.

However, each time I db.login('test', 'test'), I get the browser modal requiring to enter credentials, although test:test exists, and normally works without require_valid_user = true

tested in Firefox 42 and Chrome 47.

the relevant code:

    var db, local
    function switchDB(dbname) {
      db = new PouchDB('http://127.0.0.1:5984/' + dbname, {skipSetup: true})
      local = new PouchDB(dbname)
      local.sync(db, {live: true, retry: true}).on('error', console.log.bind(console))
      return db.login('test', 'test')
    }

I already tried http://stackoverflow.com/questions/32670580/prevent-authentication-popup-401-with-couchdb-pouchdb, which seemed to solve the issue, but I want to use fauxton on the backend which doesn't work after that.

If it doesn't work any other way, I guess I could set roles for each db as a workaround…

Contributor guide