Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 in getUser only on ios first time I open app #250

Open
goltra opened this issue Nov 8, 2018 · 1 comment
Open

404 in getUser only on ios first time I open app #250

goltra opened this issue Nov 8, 2018 · 1 comment

Comments

@goltra
Copy link

goltra commented Nov 8, 2018

Hello, I have a weird problem. I'm doing login() and after getUser() with your plugin and only on iOs and only first time I open app, I get 404.
This is the error:

{"error":"not_found","reason":"missing","status":404,"name":"not_found","message":"missing"}

If I close my app and open again, all is working fine.

This is my code:

PouchDB.plugin(PouchAuth);
  this.auth = new PouchDB(this.couchserver + '_users', {
      skip_setup: true
});
let ajaxOps = {
            ajax: {
                headers: {
                    Authorization: 'Basic ' + window.btoa(usuario + ':' + password)
                },
                body: {
                    name: usuario,
                    password: password
                }
            }
        }
        this.auth.logIn(usuario, password, ajaxOps).then(data => {
            if (data.ok != undefined && data.ok == true) {
                this.auth.getUser(usuario).then(data => {
                    resolve(data);
                }, err => {
                    reject(err);
                })
            }
        }

As I said, if I close my app and run again and it works fine. I can figure out where is the problem.

@chisNaN
Copy link

chisNaN commented Apr 10, 2019

kind same problem here
#232
will not work on MACOS safari neither
but with PWA integration there is no problem)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants