Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to find request token in session #109

Open
vaibhavarora14 opened this issue Dec 12, 2021 · 2 comments
Open

Error: Failed to find request token in session #109

vaibhavarora14 opened this issue Dec 12, 2021 · 2 comments

Comments

@vaibhavarora14
Copy link

vaibhavarora14 commented Dec 12, 2021

** READ THIS FIRST! **

Are you looking for help?

No, I am certain about issue

In Twitter callback request, the server gives an error of "500: Error: Failed to find request token in session"
OAuth token is definitely returning by Twitter in query params, but request comes as new (I compare request-id and details), and session object I see as reset.

I am trying to get the OAuth token for users which is provided by Twitter.

Expected behavior

It should be able to identify OAuth token sent back by Twitter in query params, and continue further?

Actual behavior

As far as I have understood, if the concept of session forwarding, URLs are the same as localhost, so I am not sure why the session is losing out when /callback request comes.
But because of this, it's breaking in code.

Screenshot of code when session is getting updated with oauthtoken -
image

Next thing I see in callback call, request is passed with new session object -
image

Steps to reproduce

Run https://github.com/VB-Inc/rise-in-social-backend locally

// Format code using Markdown code blocks

Environment

  • Operating System: MacOS
  • Node version: 14.18.1
  • "fastify": "3.24.1",
  • "fastify-passport": "^0.4.3",
  • "fastify-secure-session": "^3.0.0",
  • "passport": "^0.5.0",
  • "passport-twitter": "^1.0.4"
@vaibhavarora14
Copy link
Author

@jaredhanson

@vaibhavarora14
Copy link
Author

The same thing, I checked in express server with express-session also.
Looks like we will have to go back to update session again from Twitter callback query Params

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant