Skip to main content

Overview

useRequestForgotPasswordCodeByEmail hook is used to handle the process of requesting a forgot password code via email. It leverages the react-query library to manage the asynchronous operation and provides error handling and success callbacks.
useRequestForgotPasswordCodeByEmail is responsible only for requesting code. You need to implement a useUpdateUserPasswordWithCode that handles password updating process.

Example Usage

request-code-component.tsx

Parameters

() => void
required
callback function that is called when the request process is successful.
HttpErrorCallback
required
callback function that is called when an error occurs during the request process.
HttpErrorCallback type
string
required
Reset password url used to redirect user to reset password page from email. It should contain a placeholder for the reset password code.

Returns

(email: string) => void
function that triggers the request process with the provided email
boolean
boolean indicating whether the request process is currently in progress.
boolean
boolean indicating whether an error occurred during the request process.
HttpError | Error | null
error object if an error occurred during the request process.