Skip to main content

Overview

useUpdateUserPasswordWithCode hook is used to handle the process of updating a user’s password using a verification code. It leverages the react-query library to manage the asynchronous operation and provides error handling and success callbacks.
useUpdateUserPasswordWithCode is responsible for password updating for users who requested verification code by email in using useRequestForgotPasswordCodeByEmail hook.

Example Usage

update-password-with-code-component.tsx

Parameters

() => void
required
callback function that is called when the password update process is successful.
HttpErrorCallback
required
callback function that is called when an error occurs during the password update process.
HttpErrorCallback type

Returns

(payload: UpdatePasswordWithCode) => void
function that triggers the password update process with the provided payload.
UpdatePasswordWithCode type
boolean
boolean indicating whether the password update process is currently in progress.
boolean
boolean indicating whether an error occurred during the password update process.
HttpError | Error | null
error object if an error occurred during the password update process.