jaredhanson/passport-twitter

Using it with client-sessions instead of express-session

mortentz opened this issue · 1 comments

Is there any way to make passport-twitter work with client-sessions instead of express-session? We already got it working for passport-facebook, using a setup similar to this:

// Client-sessions
app.use(sessions({
    cookieName: 'user',
    secret: 'hellojared',
    duration: 24 * 60 * 60 * 1000 * 30,
    activeDuration: 1000 * 60 * 5 * 2000,
    cookie: {
        ephemeral: false, 
        httpOnly: false
    }
}));

The idea is that passport writes directly to "user". Works like a charm, except for passport-twitter, which seems to have some sort of built-in check for express-session, and simply gives the error:
"Error: OAuth authentication requires session support. Did you forget to use express-session middleware?"

We do have session support, just not in the form of express-session. Is there any work-around for this? The alternative is to set up a completely unique form of login for Twitter, including its very own DB (we run multiple instances, so out-of-the-box express session storage won't work).

Update: By the way, it also works with passport-google-oauth2, so it's mainly an issue with passport-twitter. Strange.

Thanks in advance.

Used "node-twitter-api" instead. Closing this.