diff --git a/packages/managed-auth-react/src/KernelManagedAuth.tsx b/packages/managed-auth-react/src/KernelManagedAuth.tsx index 8be1d02..64dba1a 100644 --- a/packages/managed-auth-react/src/KernelManagedAuth.tsx +++ b/packages/managed-auth-react/src/KernelManagedAuth.tsx @@ -10,6 +10,7 @@ import { StepError } from "./components/StepError"; import { StepExpired } from "./components/StepExpired"; import { LoadingState } from "./components/LoadingState"; import { ExternalActionWaiting } from "./components/ExternalActionWaiting"; +import { HumanInterventionStep } from "./components/HumanInterventionStep"; import { useLocalization } from "./localization/context"; import type { Appearance } from "./appearance/types"; import type { Localization } from "./localization/types"; @@ -120,6 +121,12 @@ function KernelManagedAuthInner({ ); } + if (uiState === "awaiting_human_intervention") { + return ( + + ); + } + if (uiState === "success") { return ; } diff --git a/packages/managed-auth-react/src/components/HumanInterventionStep.tsx b/packages/managed-auth-react/src/components/HumanInterventionStep.tsx new file mode 100644 index 0000000..aa3d5e5 --- /dev/null +++ b/packages/managed-auth-react/src/components/HumanInterventionStep.tsx @@ -0,0 +1,59 @@ +import { useSlot } from "../appearance/context"; +import { useLocalization } from "../localization/context"; + +interface HumanInterventionStepProps { + liveViewUrl?: string | null; +} + +export function HumanInterventionStep({ + liveViewUrl, +}: HumanInterventionStepProps) { + const slot = useSlot(); + const l = useLocalization(); + + return ( +
+
+

{l.humanInterventionTitle}

+

+ {l.humanInterventionMessage} +

+
+ + {liveViewUrl ? ( +
+