Trialcoder
Trialcoder

Reputation: 6014

Error: Failed to find request token in session for passport-twitter

Following is the error I am getting when using passport-twitter -

Error: Failed to find request token in session
    at Strategy.OAuthStrategy.authenticate (/MYPROJECT/node_modules/passport-twitter/node_modules/passport-oauth1/lib/strategy.js:142:54)
    at Strategy.authenticate (/MYPROJECT/node_modules/passport-twitter/lib/strategy.js:85:40)
    at attempt (/MYPROJECT/node_modules/passport/lib/middleware/authenticate.js:337:16)
    at Object.authenticate [as handle] (/MYPROJECT/node_modules/passport/lib/middleware/authenticate.js:338:7)
    at next_layer (/MYPROJECT/node_modules/express/lib/router/route.js:103:13)
    at Route.dispatch (/MYPROJECT/node_modules/express/lib/router/route.js:107:5)
    at /MYPROJECT/node_modules/express/lib/router/index.js:205:24
    at Function.proto.process_params (/MYPROJECT/node_modules/express/lib/router/index.js:269:12)
    at next (/MYPROJECT/node_modules/express/lib/router/index.js:199:19)
    at next (/MYPROJECT/node_modules/express/lib/router/index.js:176:38)

Following is the Scotch Twitter Signup tutorial I implemented, FB signup is working fine.

FYI-

I checked the configuration multiple times at twitter and everything seems ok to me(callbackURL, key, secret etc.)

I checked the following URL but no luck.

My development URL is like - http://192.XXX.XXX.XX:PORT_NUMBER

Following is my app.js app.js

Following is my passport.js passport.js

Following is my model.js buyer.js

Let me know what I am doing wrong if any as I am completely lost with the error now :(

Upvotes: 1

Views: 1617

Answers (1)

Óscar Palacios
Óscar Palacios

Reputation: 561

I was also getting that. This helped me:

https://github.com/jaredhanson/passport-twitter/issues/45#issuecomment-66934259

It was calling from localhost:300 but had my callback URL set to 127.0.0.1:3000. I changed my callback URL to localhost:3000 and the problem was solved.

Upvotes: 1

Related Questions