useWaitForLogin hook polls the Para backend until a returning user’s login is confirmed. Use it as part of a custom step-by-step auth flow after useSignUpOrLogIn returns AuthStateLogin.
Hook that polls until a login flow is complete
useWaitForLogin hook polls the Para backend until a returning user’s login is confirmed. Use it as part of a custom step-by-step auth flow after useSignUpOrLogIn returns AuthStateLogin.
import { useWaitForLogin } from "@getpara/react-native-wallet";
import { useWaitForLogin } from "@getpara/react-native-wallet";
function WaitingForLogin() {
const { waitForLoginAsync, isPending } = useWaitForLogin();
const handleWait = async () => {
try {
const result = await waitForLoginAsync({});
if (result.needsWallet) {
// Trigger wallet creation
}
} catch (err) {
console.error(err);
}
};
return <Button title={isPending ? "Waiting..." : "Check Login Status"} onPress={handleWait} disabled={isPending} />;
}