@asgardeo/react 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -171,19 +171,12 @@ export { createField, FieldFactory, validateFieldValue } from './components/fact
171
171
  export * from './components/factories/FieldFactory';
172
172
  export type { FlowStep, FlowMessage, FlowContextValue } from './contexts/Flow/FlowContext';
173
173
  export type { FlowProviderProps } from './contexts/Flow/FlowProvider';
174
- export { default as getAllOrganizations } from './api/getAllOrganizations';
175
- export { default as createOrganization } from './api/createOrganization';
176
- export { default as getMeOrganizations } from './api/getMeOrganizations';
177
- export { default as getOrganization } from './api/getOrganization';
178
- export { default as updateOrganization, createPatchOperations } from './api/updateOrganization';
179
- export { default as getSchemas } from './api/getSchemas';
180
- export { default as updateMeProfile } from './api/updateMeProfile';
181
- export type { GetAllOrganizationsConfig } from './api/getAllOrganizations';
182
- export type { CreateOrganizationConfig } from './api/createOrganization';
183
- export type { GetMeOrganizationsConfig } from './api/getMeOrganizations';
184
- export type { GetOrganizationConfig } from './api/getOrganization';
185
- export type { UpdateOrganizationConfig } from './api/updateOrganization';
186
- export type { GetSchemasConfig } from './api/getSchemas';
187
- export type { UpdateMeProfileConfig } from './api/updateMeProfile';
174
+ export { default as getAllOrganizations, GetAllOrganizationsConfig } from './api/getAllOrganizations';
175
+ export { default as createOrganization, CreateOrganizationConfig } from './api/createOrganization';
176
+ export { default as getMeOrganizations, GetMeOrganizationsConfig } from './api/getMeOrganizations';
177
+ export { default as getOrganization, GetOrganizationConfig } from './api/getOrganization';
178
+ export { default as updateOrganization, createPatchOperations, UpdateOrganizationConfig } from './api/updateOrganization';
179
+ export { default as getSchemas, GetSchemasConfig } from './api/getSchemas';
180
+ export { default as updateMeProfile, UpdateMeProfileConfig } from './api/updateMeProfile';
188
181
  export { default as getMeProfile } from './api/getScim2Me';
189
182
  export * from './api/getScim2Me';
package/dist/index.js CHANGED
@@ -4792,7 +4792,7 @@ var BaseSignInContent = ({
4792
4792
  touchAllFields();
4793
4793
  };
4794
4794
  const handleRedirectionIfNeeded = (response) => {
4795
- if ("nextStep" in response && response.nextStep && response.nextStep.stepType === EmbeddedSignInFlowStepType.AuthenticatorPrompt && response.nextStep.authenticators && response.nextStep.authenticators.length === 1) {
4795
+ if (response && "nextStep" in response && response.nextStep && response.nextStep.stepType === EmbeddedSignInFlowStepType.AuthenticatorPrompt && response.nextStep.authenticators && response.nextStep.authenticators.length === 1) {
4796
4796
  const responseAuthenticator = response.nextStep.authenticators[0];
4797
4797
  if (responseAuthenticator.metadata?.promptType === EmbeddedSignInFlowAuthenticatorPromptType.RedirectionPrompt && responseAuthenticator.metadata?.additionalData?.redirectUrl) {
4798
4798
  const redirectUrl = responseAuthenticator.metadata?.additionalData?.redirectUrl;
@@ -4880,7 +4880,7 @@ var BaseSignInContent = ({
4880
4880
  });
4881
4881
  popup.close();
4882
4882
  onFlowChange?.(response2);
4883
- if (response2.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
4883
+ if (response2?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
4884
4884
  onSuccess?.(response2.authData);
4885
4885
  }
4886
4886
  }
@@ -4921,18 +4921,18 @@ var BaseSignInContent = ({
4921
4921
  url: currentFlow?.links[0].href
4922
4922
  });
4923
4923
  onFlowChange?.(response);
4924
- if (response.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
4924
+ if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
4925
4925
  onSuccess?.(response.authData);
4926
4926
  return;
4927
4927
  }
4928
- if (response.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
4928
+ if (response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
4929
4929
  setError(t("errors.sign.in.flow.completion.failure"));
4930
4930
  return;
4931
4931
  }
4932
4932
  if (handleRedirectionIfNeeded(response)) {
4933
4933
  return;
4934
4934
  }
4935
- if ("flowId" in response && "nextStep" in response) {
4935
+ if (response && "flowId" in response && "nextStep" in response) {
4936
4936
  const nextStepResponse = response;
4937
4937
  setCurrentFlow(nextStepResponse);
4938
4938
  if (nextStepResponse.nextStep?.authenticators?.length > 0) {
@@ -4993,15 +4993,15 @@ var BaseSignInContent = ({
4993
4993
  url: currentFlow?.links[0].href
4994
4994
  });
4995
4995
  onFlowChange?.(response);
4996
- if (response.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
4996
+ if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
4997
4997
  onSuccess?.(response.authData);
4998
4998
  return;
4999
4999
  }
5000
- if (response.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
5000
+ if (response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
5001
5001
  setError(t("errors.sign.in.flow.passkeys.completion.failure"));
5002
5002
  return;
5003
5003
  }
5004
- if ("flowId" in response && "nextStep" in response) {
5004
+ if (response && "flowId" in response && "nextStep" in response) {
5005
5005
  const nextStepResponse = response;
5006
5006
  setCurrentFlow(nextStepResponse);
5007
5007
  if (nextStepResponse.nextStep?.authenticators?.length > 0) {
@@ -5047,7 +5047,7 @@ var BaseSignInContent = ({
5047
5047
  url: currentFlow?.links[0].href
5048
5048
  });
5049
5049
  onFlowChange?.(response);
5050
- if (response.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
5050
+ if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
5051
5051
  onSuccess?.(response.authData);
5052
5052
  return;
5053
5053
  }
@@ -5070,18 +5070,18 @@ var BaseSignInContent = ({
5070
5070
  url: currentFlow?.links[0].href
5071
5071
  });
5072
5072
  onFlowChange?.(response);
5073
- if (response.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
5073
+ if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
5074
5074
  onSuccess?.(response.authData);
5075
5075
  return;
5076
5076
  }
5077
- if (response.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
5077
+ if (response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
5078
5078
  setError("Authentication failed. Please check your credentials and try again.");
5079
5079
  return;
5080
5080
  }
5081
5081
  if (handleRedirectionIfNeeded(response)) {
5082
5082
  return;
5083
5083
  }
5084
- if ("flowId" in response && "nextStep" in response) {
5084
+ if (response && "flowId" in response && "nextStep" in response) {
5085
5085
  const nextStepResponse = response;
5086
5086
  setCurrentFlow(nextStepResponse);
5087
5087
  if (nextStepResponse.nextStep?.authenticators?.length > 0) {
@@ -5121,18 +5121,18 @@ var BaseSignInContent = ({
5121
5121
  url: currentFlow?.links[0].href
5122
5122
  });
5123
5123
  onFlowChange?.(response);
5124
- if (response.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
5124
+ if (response?.flowStatus === EmbeddedSignInFlowStatus.SuccessCompleted) {
5125
5125
  onSuccess?.(response.authData);
5126
5126
  return;
5127
5127
  }
5128
- if (response.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
5128
+ if (response?.flowStatus === EmbeddedSignInFlowStatus.FailCompleted || response?.flowStatus === EmbeddedSignInFlowStatus.FailIncomplete) {
5129
5129
  setError("Authentication failed. Please try again.");
5130
5130
  return;
5131
5131
  }
5132
5132
  if (handleRedirectionIfNeeded(response)) {
5133
5133
  return;
5134
5134
  }
5135
- if ("flowId" in response && "nextStep" in response) {
5135
+ if (response && "flowId" in response && "nextStep" in response) {
5136
5136
  const nextStepResponse = response;
5137
5137
  setCurrentFlow(nextStepResponse);
5138
5138
  if (nextStepResponse.nextStep?.authenticators?.length > 0) {
@@ -5163,7 +5163,7 @@ var BaseSignInContent = ({
5163
5163
  }
5164
5164
  }
5165
5165
  } catch (err) {
5166
- const errorMessage = err instanceof AsgardeoAPIError2 ? err.message : "Authenticator selection failed";
5166
+ const errorMessage = err instanceof AsgardeoAPIError2 ? err?.message : "Authenticator selection failed";
5167
5167
  setError(errorMessage);
5168
5168
  onError?.(err);
5169
5169
  } finally {