Skip to main content

Overview

useCreateIdentityProviderIntent hook is used to create an identity provider intent. It leverages the react-query library to manage the asynchronous operation and provides error handling and success callbacks.

Parameters

onSuccess
(response: CreateIdentityProviderIntentResponse) => void
required
callback function that is called when the creation process is successful. It receives the CreateIdentityProviderIntentResponse object as an argument.
CreateIdentityProviderIntentResponse type
type CreateIdentityProviderIntentResponse = {
  authUrl: string;
};
onError
HttpErrorCallback
required
callback function that is called when an error occurs during the creation process.
HttpErrorCallback type
type HttpErrorCallback = (error: HttpError | Error | undefined) => void;

Returns

createIdentityProviderIntent
(request: CreateIdentityProviderIntentRequest) => void
function that triggers the creation process with the provided payload.
CreateIdentityProviderIntentRequest type
type CreateIdentityProviderIntentRequest = {
  idpId: string;
  successUrl: string;
  failureUrl: string;
};
isLoading
boolean
boolean indicating whether the creation process is currently in progress.
isError
boolean
boolean indicating whether an error occurred during the creation process.
error
HttpError | Error | null
error object if an error occurred during the creation process.