formsmfa enrollment

mfa enrollment

shared TOTP enrollment flow used by every halwel surface. three phases — fetch secret, scan QR + verify 6-digit code, save the 10 backup codes — driven by a single component that the patient, provider, and HQ apps mount with their own HTTP plumbing.

tap a button below to walk through each mode. the fixtures here are static — the verify step accepts any 6 digits in the demo and shows 10 deterministic backup codes.

import from @halwel/ui/components/auth/MfaEnrollmentModal

variants

dismissible — settings opt-in

cancel + esc + backdrop click all close the modal until backup codes are shown. mirrors the patient/provider/hq settings/security card flow.

required — first-login onboarding gate

no cancel affordance, escape ignored. used by /onboarding/mfa for provider + HQ first logins.

failing verify — error inline

calls onConfirm that always rejects so you can see the inline error banner state.