-
Notifications
You must be signed in to change notification settings - Fork 114
Description
Trying to implement a login system with this plugin (in PhoneGap):
Code
remoteDB = new PouchDB('https://MYACCOUNT.cloudant.com/DATABASE');
remoteDB.logIn('USER', 'PASSWORD').then(function(response) {
console.log(response);
});
remoteDB.getSession(function (error, response) {
console.log(response);
});
Current Behaviour
-
It works if I open the index.html from the macOS Finder, such that the address bar reads
file:///Users/USER/Documents/pouchdblogin/www/index.html. -
However, if I run it via PhoneGap (
http://192.168.0.3:3000/), the login doesn't seem to work:
In both cases, the logIn response is
{roles: Array(0), ok: true, name: "fb10213293253078466"}
But the getSession responses are different:
1. For file:///..........:
info.authenticated: "cookie"
userCtx.name: "USER"
-> Expected behaviour
2. but for http://192.168.0.3:3000/ it is:
info.authenticated: "local"
userCtx.name: null
-> Login didn't work properly
Am I doing something wrong?
Environment
- Version of PouchDB Authentication: 1.1.2
- Version of PouchDB: 6.4.3
- Server: Cloudant