BETTER-AUTH. UI
Mutations

useRequestPhoneNumberPasswordReset

Send the code used to reset a phone credential password.

Configure Better Auth sendPasswordResetOTP before exposing this action.

Usage

import type { PhoneNumberAuthClient } from "@better-auth-ui/core/plugins/phone-number"
import { useAuth } from "@better-auth-ui/solid"
import { useRequestPhoneNumberPasswordReset } from "@better-auth-ui/solid/plugins/phone-number"

const { authClient } = useAuth()
const requestReset = useRequestPhoneNumberPasswordReset(
  authClient as PhoneNumberAuthClient
)

requestReset.mutate({ phoneNumber: "+12025550123" })

Options factory

import { requestPhoneNumberPasswordResetOptions } from "@better-auth-ui/core/plugins/phone-number"
import { useMutation } from "@tanstack/solid-query"

const requestReset = useMutation(() =>
  requestPhoneNumberPasswordResetOptions(authClient)
)

Params

Prop

Type

Last updated on

On this page