GithubHelp home page GithubHelp logo

Comments (5)

quanglam2807 avatar quanglam2807 commented on July 4, 2024

Finally, I make it work!

host: "cloudant_account.cloudant.com/_all_dbs",

to

host: "cloudant_account.cloudant.com",

Still, I think we need to add log for this.

from superlogin.

colinskow avatar colinskow commented on July 4, 2024

Yes, host must be set to the root of your CouchDB or Cloudant server, not /_all_dbs. SuperLogin won't actually try to connect to the DB until you attempt to perform an actions such as login or registration. If it cannot connect, it should throw an error the first action you try to perform.

Any errors thrown will go to console.error so you should be able to use a logger like morgan to capture these.

If you have any specific suggestions for how to improve this, let me know.

from superlogin.

colinskow avatar colinskow commented on July 4, 2024

OK, I did confirm that when the DB connection fails, the API seems to wait forever and gives no error. This is because there is no timeout set on PouchDB. I'll add a feature in the next release so you can set your own personal timeout, and you should get a correct error after that.

from superlogin.

colinskow avatar colinskow commented on July 4, 2024

Apparently, if a Node.js request is unable to connect to the server, then the timeout is set by your operating system (generally between 20 and 120 seconds) and there is no easy way to override it. So unfortunately if your DB is configured wrong or isn't responding, then the SuperLogin API is going to hang for a while. I don't think there's much we can do about it.

from superlogin.

colinskow avatar colinskow commented on July 4, 2024

OK, I fixed a bug in the /login code, which was preventing the promise from correctly rejecting. It will now display the error: Error: connect ECONNREFUSED 127.0.0.1:5984 if unable to connect. I will upload this fix with the next release shortly.

from superlogin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.