Used Twitch Authentication
OAuth Redirect URLs on Twitch Developer Console: Sign-in Complete
Set the useProxy as true. But after Authorizing in Twitch, the next screen shows up as follows
WebBrowser.maybeCompleteAuthSession();
// Endpoint
const discovery = {
authorizationEndpoint: "https://id.twitch.tv/oauth2/authorize",
tokenEndpoint: "https://id.twitch.tv/oauth2/token",
revocationEndpoint: "https://id.twitch.tv/oauth2/revoke",
};
const Twitch = () => {
const [request, response, promptAsync] = useAuthRequest(
{
clientId: TWITCH_CLIENT_ID,
redirectUri: makeRedirectUri({
useProxy: true,
// scheme:"your.app"
}),
scopes: ["openid", "user_read"],
},
discovery
);
React.useEffect(() => {
if (response?.type === "success") {
const { code } = response.params;
console.log(response);
}
}, [response]);
return (
<Button
disabled={!request}
title="Twitch Login"
onPress={() => {
promptAsync();
}}
/>
);
};