BETTER-AUTH. UI
Mutations

useResetPhoneNumberPassword

Reset a phone credential password with a verification code.

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

const { authClient } = useAuth()
const { mutate: resetPassword } = useResetPhoneNumberPassword(
  authClient as PhoneNumberAuthClient
)

resetPassword({
  phoneNumber: "+12025550123",
  otp: "123456",
  newPassword
})

Options factory

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

const { mutate } = useMutation(resetPhoneNumberPasswordOptions(authClient))

Params

Prop

Type

Last updated on

On this page