UNPKG

@better-auth-ui/core

Version:

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

22 lines (21 loc) 1.35 kB
import { MutationOptions } from '@tanstack/query-core'; import { BetterFetchError } from 'better-auth/client'; import { DeviceAuthorizationAuthClient } from './device-authorization-auth-client'; export type VerifyDeviceCodeParams<TAuthClient extends DeviceAuthorizationAuthClient> = Parameters<TAuthClient["device"]>[0]; export type VerifyDeviceCodeOptions<TAuthClient extends DeviceAuthorizationAuthClient> = Omit<ReturnType<typeof verifyDeviceCodeOptions<TAuthClient>>, "mutationKey" | "mutationFn">; /** * Mutation options factory for verifying and claiming a device code. * * @param authClient - The Better Auth client with the device-authorization plugin. */ export declare function verifyDeviceCodeOptions<TAuthClient extends DeviceAuthorizationAuthClient>(authClient: TAuthClient): MutationOptions<Awaited<ReturnType<(params: VerifyDeviceCodeParams<TAuthClient>) => Promise<NonNullable<{ user_code: string; status: string; client_id?: string | undefined; scope?: string | undefined; } & Partial<Record<string, unknown> | Record<never, never>>>>>>, BetterFetchError, Parameters<(params: VerifyDeviceCodeParams<TAuthClient>) => Promise<NonNullable<{ user_code: string; status: string; client_id?: string | undefined; scope?: string | undefined; } & Partial<Record<string, unknown> | Record<never, never>>>>>[0]>;