examples icon indicating copy to clipboard operation
examples copied to clipboard

Twitter example not working with v41

Open jojenki opened this issue 4 years ago • 0 comments

Describe the bug I recently upgraded to v41 from v40, and this stopped working. Specifically, the following code:

      // Step #2 - after we received the request tokens, we can start the auth session flow using
      // these tokens
      const authResponse = await AuthSession.startAsync({
        authUrl:
            'https://api.twitter.com/oauth/authorize' +
            toQueryString(requestTokens),
        returnUrl: 'http://localhost:19006/'
      });

This used to open a new, small window that was Twitter's OAuth page, where I could approve the request. Now, it opens the new, small window, but it just goes straight back to my app. The URL is like:

http://localhost:19006/start?authUrl=https%3A%2F%2Fapi.twitter.com%2Foauth%2Fauthorize%3Foauth_token%3DREDACTED%26oauth_token_secret%3DREDACTED%26oauth_callback_confirmed%3Dtrue&returnUrl=http%3A%2F%2Flocalhost%3A19006%2F

It's almost like this /start path should apply a redirect, but it is not.

To Reproduce Steps to reproduce the behavior:

  1. Clone the auth-with-twitter example
  2. Run it
  3. Observe that the process fails as described above at step 2

Expected behavior The request in the new, small window should redirect to the authUrl, e.g. https://api.twitter.com/oauth/authorize.

Screenshots If applicable, add screenshots to help explain your problem.

Capture

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 90.0.4430.85

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

jojenki avatar Apr 27 '21 23:04 jojenki