> ## Documentation Index
> Fetch the complete documentation index at: https://iam-docs.razi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# useUpdateUserPasswordWithCurrentPassword()

## Overview

**useUpdateUserPasswordWithCurrentPassword** hook is used to handle the process of updating a user's password using their current password.
It leverages the react-query library to manage the asynchronous operation and provides error handling and success callbacks.

<Warning>
  After changing the user's password, their session will be terminated, and they will need to log in again using the new password.
</Warning>

## Parameters

<ResponseField name="onSuccess" type="() => void" required>
  callback function that is called when the password update process is successful.

  <SessionType />
</ResponseField>

<ResponseField name="onError" type="HttpErrorCallback" required>
  callback function that is called when an error occurs during the password update process.

  <HttpErrorCallbackType />
</ResponseField>

## Returns

<ResponseField name="updateUserPassword" type="(payload: UpdatePasswordUsingCurrentPassword) => void">
  function that triggers the password update process with the provided payload.

  ```typescript UpdatePasswordUsingCurrentPassword type
  type UpdatePasswordUsingCurrentPassword = {
    currentPassword: string;
    newPassword: string;
  };
  ```
</ResponseField>

<ResponseField name="isLoading" type="boolean">
  boolean indicating whether the password update process is currently in progress.
</ResponseField>

<ResponseField name="isError" type="boolean">
  boolean indicating whether an error occurred during the password update process.
</ResponseField>

<ResponseField name="error" type="HttpError | Error | null">
  error object if an error occurred during the password update process.
</ResponseField>
