examples
examples copied to clipboard
Getting type: dismiss for twitter
Describe the bug In twitter example, for AuthSession I'm getting
Auth response received! Object {
"type": "dismiss",
}
To Reproduce Steps to reproduce the behavior:
- 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).
- on Twitter developer App Details enable Sign in with Twitter.
- Add the callback
exp://
(as for the output fromconsole.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";
- run
expo start
in your root file - run
node index.js
in backend folder - From your mobile, download expo client, and scan QR code
- 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
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
Same here, added the returnUrl which I set to AuthSession.makeRedirectUri() and everything worked as expected.
@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?
Thank you @classicalguss! This solved my issue with Android on Auth0 too.
Any one facing this in bare workflow?
Same case with our bare workflow project
Any one facing this in bare workflow?
Same case with our bare workflow project
Have you found any solution ? Facing the same issue .