diff --git a/.changeset/rich-forks-tickle.md b/.changeset/rich-forks-tickle.md new file mode 100644 index 00000000..a09274ba --- /dev/null +++ b/.changeset/rich-forks-tickle.md @@ -0,0 +1,6 @@ +--- +'@asgardeo/javascript': patch +'@asgardeo/react': patch +--- + +Fix component type issues diff --git a/packages/javascript/src/models/v2/embedded-flow-v2.ts b/packages/javascript/src/models/v2/embedded-flow-v2.ts index fffc4716..32f5e4f6 100644 --- a/packages/javascript/src/models/v2/embedded-flow-v2.ts +++ b/packages/javascript/src/models/v2/embedded-flow-v2.ts @@ -47,6 +47,12 @@ export enum EmbeddedFlowComponentType { /** Email input field with validation for email addresses. */ EmailInput = 'EMAIL_INPUT', + /** One-time password input field for multi-factor authentication */ + OtpInput = 'OTP_INPUT', + + /** Phone number input field with country code support */ + PhoneInput = 'PHONE_INPUT', + /** Text display component for labels, headings, and messages */ Text = 'TEXT', diff --git a/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx b/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx index a498ad15..5eee3c7e 100644 --- a/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx +++ b/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx @@ -265,12 +265,9 @@ const createAuthComponentFromFlow = ( } default: - throw new AsgardeoRuntimeError( - `Unsupported component type: ${component.type}`, - `${authType === 'signin' ? 'SignIn' : 'SignUp'}-UnsupportedComponentType-001`, - 'react', - `Something went wrong while rendering the ${authType} component. Please try again later.`, - ); + // Gracefully handle unsupported component types by returning null + console.warn(`Unsupported component type: ${component.type}. Skipping render.`); + return null; } };