examples icon indicating copy to clipboard operation
examples copied to clipboard

Getting type: dismiss for twitter

Open classicalguss opened this issue 4 years ago • 6 comments

Describe the bug In twitter example, for AuthSession I'm getting

Auth response received! Object {
  "type": "dismiss",
}

To Reproduce Steps to reproduce the behavior:

  1. Go to index.js in backend and replace consumer_key & consumer_secret with your Twitter app Consumer API keys (API Key, API Secret Key respectively).
  2. on Twitter developer App Details enable Sign in with Twitter.
  3. Add the callback exp:// (as for the output from console.log(Callback URL: ${redirect}) it displays schema with the host like exp://192.168.1.29 ... but that won't be allowed by Twitter) 4.Depending on your LAN IP In App.js replace requestTokenURL & accessTokenURL with something like this
const requestTokenURL = "http://192.168.1.29:3000/request-token";
const accessTokenURL = "http://192.168.1.29:3000/access-token";
  1. run expo start in your root file
  2. run node index.js in backend folder
  3. From your mobile, download expo client, and scan QR code
  4. Try to login. You will get the following
Auth response received! Object {
  "type": "dismiss",
}

Expected behavior

Auth response received! Object {
  "type": "success",
...
}

Desktop (please complete the following information):

  • OS: MacOS
  • Browser N/A

Smartphone (please complete the following information):

  • Device: Huwawei
  • OS: Android
  • Browser Chrome

Additional context console.log("Request tokens fetched!", requestTokens); outputs valid tokens

classicalguss avatar Jul 07 '20 23:07 classicalguss

I solved the issue when I added returnUrl to AuthSession.startSync

// 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/authenticate" +
          toQueryString(requestTokens),
        returnUrl: redirect
      });

Maybe this should be mentioned in the ReadMe? I'm not very sure, since I don't have a lot of experience with AuthSession

classicalguss avatar Jul 08 '20 00:07 classicalguss

Same here, added the returnUrl which I set to AuthSession.makeRedirectUri() and everything worked as expected.

Collins1738 avatar Feb 11 '21 06:02 Collins1738

@classicalguss I m facing the same issue in Android bare workflow, if I set the redirectUrl it open the browser with an error validationError: "returnUrl" must be a valid uri Any one facing this in bare workflow?

Moumene avatar Dec 20 '21 16:12 Moumene

Thank you @classicalguss! This solved my issue with Android on Auth0 too.

mraible avatar Aug 30 '22 17:08 mraible

Any one facing this in bare workflow?

Same case with our bare workflow project

polcats avatar Sep 05 '22 07:09 polcats

Any one facing this in bare workflow?

Same case with our bare workflow project

Have you found any solution ? Facing the same issue .

komal1502 avatar Dec 07 '22 12:12 komal1502