I tried use expo-auth-session with twitch, however I always get a {"type": "dismiss"}
as a response and I don’t know why. please help!
I am using “expo-auth-session”: “~3.7.2”
const TwitchButton = () => {
const discovery = {
authorizationEndpoint: 'https://id.twitch.tv/oauth2/authorize',
tokenEndpoint: 'https://id.twitch.tv/oauth2/token',
revocationEndpoint: 'https://id.twitch.tv/oauth2/revoke',
};
const [request, response, promptAsync] = useAuthRequest(
{
clientId: "79hlr2x38cxf93pmvag21yavc8haxf",
redirectUri: makeRedirectUri({
scheme: "myapp",
useProxy: false
}),
scopes: ['user:read:email'],
},
discovery
);
useEffect(() => {
console.log(response)
if (response?.type === 'success') {
const { code } = response.params;
console.log(code)
}
}, [response]);
return (
<Button
disabled={!request}
title="Login with twitch"
onPress={() => {
promptAsync();
}}
/>
);
}