-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
I'm converting session storage for an app from MemoryStore to connect-couchdb. The login page is now flaky, and I think it is because the new session storage is slow enough that it has highlighted a race.
It looks like the successful login is redirecting (in our case successReturnToOrRedirect: '/'), and the 'session get' for / occurs before the 'session set' has written to the database. I've used some extra logging through the connect-couchdb and passport code to confirm this.
Is there a way to make sure req.session.save is called and completes before res.redirect gets called on success? The optional callback you can pass into authenticate() replaces all builtin handling, I was hoping for a solution where it can be augmented.
Any thoughts on this?
Cheers,
Eddie