BETTER-AUTH. UI
Mutations

useResetPassword

Reset a password with a Better Auth token.

Usage

import { useResetPassword } from "@better-auth-ui/solid"

const mutation = useResetPassword(authClient)

mutation.mutate(/* params */)

Options factory

import { resetPasswordOptions } from "@better-auth-ui/core"
import { useMutation } from "@tanstack/solid-query"

const resetPassword = useMutation(() => resetPasswordOptions(authClient))
const token = new URLSearchParams(window.location.search).get("token")

const newPassword = formPasswordValue

if (token) {
  resetPassword.mutate({ token, newPassword })
}

Params

Prop

Type

Last updated on

On this page