UNPKG

@better-auth-ui/core

Version:

Authentication components and data utilities for [Better Auth](https://better-auth.com), available for React and Solid.

12 lines (11 loc) 938 B
import { MutationOptions } from '@tanstack/query-core'; import { BetterFetchError } from 'better-auth/client'; import { TwoFactorAuthClient } from './two-factor-auth-client'; export type SendTwoFactorOtpParams<TAuthClient extends TwoFactorAuthClient> = Parameters<TAuthClient["twoFactor"]["sendOtp"]>[0]; export type SendTwoFactorOtpOptions<TAuthClient extends TwoFactorAuthClient> = Omit<ReturnType<typeof sendTwoFactorOtpOptions<TAuthClient>>, "mutationKey" | "mutationFn">; /** Mutation options factory for emailing a second-factor code. */ export declare function sendTwoFactorOtpOptions<TAuthClient extends TwoFactorAuthClient>(authClient: TAuthClient): MutationOptions<Awaited<ReturnType<(params?: void | SendTwoFactorOtpParams<TAuthClient> | undefined) => Promise<{ status: boolean; }>>>, BetterFetchError, Parameters<(params?: void | SendTwoFactorOtpParams<TAuthClient> | undefined) => Promise<{ status: boolean; }>>[0]>;