I try to use authentication plugin. In Chrome it works as described.
Current Behavior
In Firefox, it does not work due to CORS. Message follows:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://IP:5984/_session. (Reason: CORS request did not succeed).
Obviously, I have CORS enabled and syncing PouchDB with CouchDB works in Firefox...
Possible Solution
Steps to Reproduce (for bugs)
var db_remote = new PouchDB('http://IP:5984/templates'); db_remote.logIn(username, password, function(err, response) { if (err) { console.log(err) if (err.name === 'unauthorized' || err.name === 'forbidden') { // name or password incorrect console.log(err.name) alert("Username or password is incorrect!") } else { // cosmic rays, a meteor, etc. alert("Something went wrong!") } } else { console.log(response) window.open("test.html", '_self'); } });
Context
I tried to follow the instructions to setup. The only thing I skipped is syncing the remote CouchDB to a local pouchDB. Could that be the problem?
Expected Behavior
I try to use authentication plugin. In Chrome it works as described.
Current Behavior
In Firefox, it does not work due to CORS. Message follows: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://IP:5984/_session. (Reason: CORS request did not succeed). Obviously, I have CORS enabled and syncing PouchDB with CouchDB works in Firefox...
Possible Solution
Steps to Reproduce (for bugs)
var db_remote = new PouchDB('http://IP:5984/templates'); db_remote.logIn(username, password, function(err, response) { if (err) { console.log(err) if (err.name === 'unauthorized' || err.name === 'forbidden') { // name or password incorrect console.log(err.name) alert("Username or password is incorrect!") } else { // cosmic rays, a meteor, etc. alert("Something went wrong!") } } else { console.log(response) window.open("test.html", '_self'); } });
Context
I tried to follow the instructions to setup. The only thing I skipped is syncing the remote CouchDB to a local pouchDB. Could that be the problem?
Your Environment