Skip to main content

Overview

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

Parameters

onSuccess
(session: Session | undefined) => void
required
callback function that is called when the validation process is successful. It receives the Session object as an argument.
Session type
type Session = {
  sessionId: string;
  sessionToken: string;
  userId: string;
};
onError
HttpErrorCallback
required
callback function that is called when an error occurs during the validation process.
HttpErrorCallback type
type HttpErrorCallback = (error: HttpError | Error | undefined) => void;

Returns

validateIdentityProviderIntent
(request: ValidateIdentityProviderIntentRequest) => void
function that triggers the validation process with the provided payload.
ValidateIdentityProviderIntentRequest type
type ValidateIdentityProviderIntentRequest = {
  intentId: string;
  idpToken: string;
};
isLoading
boolean
boolean indicating whether the validation process is currently in progress.
isError
boolean
boolean indicating whether an error occurred during the validation process.
error
HttpError | Error | null
error object if an error occurred during the validation process.