Mutations
useRequestPhoneNumberPasswordReset
Send the code used to reset a phone credential password.
Configure Better Auth sendPasswordResetOTP before exposing this action.
import type { PhoneNumberAuthClient } from "@better-auth-ui/core/plugins/phone-number"
import { useAuth } from "@better-auth-ui/react"
import { useRequestPhoneNumberPasswordReset } from "@better-auth-ui/react/plugins/phone-number"
const { authClient } = useAuth()
const { mutate: requestReset } = useRequestPhoneNumberPasswordReset(
authClient as PhoneNumberAuthClient
)
requestReset({ phoneNumber: "+12025550123" })Options factory
import { requestPhoneNumberPasswordResetOptions } from "@better-auth-ui/core/plugins/phone-number"
import { useMutation } from "@tanstack/react-query"
const { mutate } = useMutation(
requestPhoneNumberPasswordResetOptions(authClient)
)Params
Prop
Type
Last updated on