Closed gouteru closed 3 years ago
Have you solved it?
Not solved yet. but I got a workaround. Redirect from express app to my app's another page (not the same path of authenticate() is waiting for response), then store tokens included as URL query from express app onto localStorage then close popup window with a JS function, then popup close is handled by authenticate() and obtain tokens stored in localStorage.
make sure your Redirect Uri and Callback URL are the same.
I have succeeded to get Twitter access_token and access_token_secret on my express app. but the popup window is not closed and the JSON response from express app is not returned to the client properly. The JSON response is shown on the popup. The client waits the response but nothings returned.
I have edited the example server.js to get access_token and accss_token_secret because I have been working on a kind of twitter emu app. Please help how I can get the response JSON.
Mac OS10.15.4 Chrome: 83.0.4103.61 vue: 2.6.12 client app url:
http://127.0.0.1:8080/#/auth/OpenAuth
express app url:http://127.0.0.1:4000
Callback URL of Twitter app on Twitter Developerhttp://127.0.0.1:4000/auth/twitter/callback
Here's serever.js I modified twitter auth like below.
I added the below callback function for twitter.
the first part for request token.
The client code is here.