You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, and thanks for the bugreport! Sorry for not getting to it sooner.
The basic issue is:
GetRequestTokenAndUrl returns a RequestToken and a URL
The user is sent to that URL (and is subsequently redirected back to us along with a verification code).
When calling AuthorizeToken: the RequestToken must be the same token from step 1. (There's an association between the request token, and some parameters in the URL we redirect the user to.)
So, it's not going to work to call GetRequestTokenAndUrl a second time to get a new RequestToken. Instead we must save the token from the first call.
Please let me know if this helps you get your code working! If you're happy, we can close out this bug.
One other unrelated/side note:
When redirecting the user: you probably want to consider "http.StatusTemporaryRedirect" instead of "http.StatusMovedPermanently". They both cause the user to be redirected. However, the second status will (usually) cause the browser to skip over your server, and redirect straight to twitter (this is bad because GetRequestTokenAndUrl won't be called!). The temporary redirect status will ensure the browser always checks your server first, before being redirected.
Looking at Twitter example I tried to implement it for my project. Below you can see 2 functions:
But I am getting:
My code:
The text was updated successfully, but these errors were encountered: