{
// If a factor has been created (but not verified), unenroll it. This will be run as a
// side effect so that it's not confusing to the user why the modal stays open while
// unenrolling.
if (factor) unenroll({ factorId: factor.id })
}}
onConfirm={() => factor && challengeAndVerify({ factorId: factor.id, code })}
>
Use an authenticator app to scan the following QR code, and provide the code from the app
to complete the enrolment.
{isLoading && (
)}
{factor && (
<>
}
/>
setCode(e.target.value)}
/>
>
)}
)
}
export default AddNewFactorModal