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) 874 B
import { MutationOptions } from '@tanstack/query-core'; import { BetterFetchError } from 'better-auth/client'; import { TwoFactorAuthClient } from './two-factor-auth-client'; export type GetTotpUriParams<TAuthClient extends TwoFactorAuthClient> = Parameters<TAuthClient["twoFactor"]["getTotpUri"]>[0]; export type GetTotpUriOptions<TAuthClient extends TwoFactorAuthClient> = Omit<ReturnType<typeof getTotpUriOptions<TAuthClient>>, "mutationKey" | "mutationFn">; /** Mutation options factory for re-reading an enrolled user's TOTP URI. */ export declare function getTotpUriOptions<TAuthClient extends TwoFactorAuthClient>(authClient: TAuthClient): MutationOptions<Awaited<ReturnType<(params: GetTotpUriParams<TAuthClient>) => Promise<{ totpURI: string; }>>>, BetterFetchError, Parameters<(params: GetTotpUriParams<TAuthClient>) => Promise<{ totpURI: string; }>>[0]>;