Skip to content
Twentyfirst UIHalo

Two Factor Setup

Forms · TwoFactorSetup

Turning on two-factor sign-in: scan, confirm with a code, save recovery codes.

Props: qr (node: render the otpauth URI with your QR library), secret, onVerify(code) (return or resolve true/false), codes (recovery codes), onDownload, onDone, step, scanText, codesText.

  • The last step stays locked until the person confirms they saved the codes. (In this preview the code 123456 works.)
  1. 1Scan
  2. 2Confirm
  3. 3Save codes

Scan the code with your authenticator app. If you can't scan it, enter the key by hand.

Props

TwoFactorSetup

PropTypeNotes
qr?ReactNode
secretstringRequired
onVerify?(code: string) => boolean | Promise<boolean>
codes?string[]
onDownload?() => void
onDone?() => void
step?0 | 1 | 2
scanText?string
codesText?string
className?stringExtra class on the root element.
style?CSSPropertiesInline style on the root element.