adriantanasa / connect-cloudant-store

NodeJS express-session storage connector for IBM Cloudant
MIT License
14 stars 6 forks source link

Cloudant throws a uncaught 404 error when session first created #2

Open terminalid opened 5 years ago

terminalid commented 5 years ago

Hello This might not be an issue with connect-cloudant-store, and may indeed be an implementation mistake on my part. However, not knowing where else to start, I thought I'd ask here first.

Setup

This is a bluemix hosted app using passport to connect to W3id (IBM sso using Oauth). Since we use cloudant for other tasks on the site, I thought I'd use it for our session store.

The issues

When a new session is invoked, a new record for the session is created in cloudant, but I also receive a 404 error in the console. I presume this is some piece of middleware checking if the session exists, but I would expect that middleware to catch such an error and either realize it's a new session or wait for the record to be writing.

Am I supposed to catch the error? and if so, How? Or perhaps I haven't implemented Express/Passport/Cloudant-store correctly?

Thanks for your help