UNPKG

@leancodepl/kratos

Version:

Headless React components library for building Ory Kratos authentication flows

38 lines (37 loc) 1.72 kB
import { ComponentType, ReactNode } from "react"; import { AuthError } from "../../../utils"; import { OnLoginFlowError } from "../types"; /** * Props for the SecondFactorForm component. * * @property {ComponentType<{ children: ReactNode }>} [Email] - Optional component for rendering the Email button for second factor authentication. * @property {ComponentType<{ children: ReactNode }>} Totp - Component for rendering the TOTP (Time-based One-Time Password) input field. * @property {ComponentType<{ children: ReactNode }>} Submit - Component for rendering the TOTP submit button. * @property {AuthError[]} errors - Array of authentication errors to display to the user. * @property {boolean | undefined} isRefresh - Indicates if the flow is for refresh credentials. * @property {boolean} isSubmitting - Indicates if the form is currently being submitted. * @property {boolean} isValidating - Indicates if the form is currently being validated. */ export type SecondFactorFormProps = { Email?: ComponentType<{ children: ReactNode; }>; Totp: ComponentType<{ children: ReactNode; }>; Submit: ComponentType<{ children: ReactNode; }>; errors: AuthError[]; isRefresh: boolean | undefined; isSubmitting: boolean; isValidating: boolean; }; type SecondFactorFormWrapperProps = { secondFactorForm: ComponentType<SecondFactorFormProps>; isRefresh: boolean | undefined; onError?: OnLoginFlowError; onLoginSuccess?: () => void; }; export declare function SecondFactorFormWrapper({ secondFactorForm: SecondFactorForm, isRefresh, onError, onLoginSuccess, }: SecondFactorFormWrapperProps): import("react/jsx-runtime").JSX.Element; export {};