Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/rich-forks-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@asgardeo/javascript': patch
'@asgardeo/react': patch
---

Fix component type issues
6 changes: 6 additions & 0 deletions packages/javascript/src/models/v2/embedded-flow-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

Expand Down
Loading