Overview
useSignIn hook is used to handle the sign-in process using email and password. It leverages the react-query library to manage the asynchronous operation and provides error handling and success callbacks.Example Usage
sign-in-component.tsx
Parameters
(session: Session | undefined) => void
required
callback function that is called when the sign-in process is successful. It receives the Session object as an argument.
Session type
HttpErrorCallback
required
callback function that is called when an error occurs during the sign-in process.
HttpErrorCallback type
Returns
({ email, password }) => void
function that triggers the sign-in process with the provided email and password.
boolean
boolean indicating whether the sign-in process is currently in progress.
boolean
boolean indicating whether an error occurred during the sign-in process.
HttpError | Error
error object containing details of the error that occurred during the sign-in process.