useVerifyOAuth hook handles the OAuth redirect and polling step of the authentication flow. Use it as part of a custom step-by-step auth flow, or prefer useAuthenticateWithOAuth for an all-in-one approach.
Hook for verifying OAuth authentication
useVerifyOAuth hook handles the OAuth redirect and polling step of the authentication flow. Use it as part of a custom step-by-step auth flow, or prefer useAuthenticateWithOAuth for an all-in-one approach.
import { useVerifyOAuth } from "@getpara/react-native-wallet";
import { useVerifyOAuth } from "@getpara/react-native-wallet";
import * as WebBrowser from "expo-web-browser";
function OAuthStep() {
const { verifyOAuthAsync, isPending } = useVerifyOAuth();
const handleVerify = async () => {
try {
const result = await verifyOAuthAsync({
method: "GOOGLE",
appScheme: "myapp",
onOAuthUrl: (url) => WebBrowser.openBrowserAsync(url),
});
} catch (err) {
console.error(err);
}
};
return <Button title="Verify with Google" onPress={handleVerify} disabled={isPending} />;
}