BETTER-AUTH. UI
Mutations

getTotpUriOptions

Re-read the TOTP URI of an enrolled user.

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/core/plugins/two-factor.

This operation is a mutation because the endpoint uses POST. It accepts the password and returns a secret that the application must not cache.

Options factory

import { getTotpUriOptions } from "@better-auth-ui/core/plugins/two-factor"
import { createMutation } from "@tanstack/solid-query"

const getTotpUri = createMutation(() => getTotpUriOptions(authClient))

getTotpUri.mutate({ password: "current-password" })

Params

Prop

Type

Last updated on

On this page