BETTER-AUTH. UI
Mutations

verifyTwoFactorOtpOptions

Verify the emailed second-factor code.

Requires the Better Auth two-factor plugin. If TypeScript cannot infer the plugin methods from your client, type or cast authClient as TwoFactorAuthClient from @better-auth-ui/solid.

Send the code with sendTwoFactorOtpOptions first. Refetches the session on success.

Options factory

import { verifyTwoFactorOtpOptions } from "@better-auth-ui/solid"
import { createMutation } from "@tanstack/solid-query"

const verifyOtp = createMutation(() => verifyTwoFactorOtpOptions(authClient))

verifyOtp.mutate({ code: "123456", trustDevice: true })

Params

Prop

Type

Last updated on

On this page