Skip to content

Pages · Reference

TwoFactor

Complete the second verification step during sign-in.

Preview

Loading preview…

Usage

tsx
import { TwoFactor } from "@krak-stack/auth/two-factor/react";

export const Example = () => <TwoFactor defaultRedirectTo="/" />;

Mount TwoFactor on /2fa to complete sign-in with an authenticator app, an email code, or a backup code.

React refreshes the session and navigates after verification. With Effect UI HTML, use TwoFactorLive and handle its Authenticated event in the host to refresh the session and navigate.