Skip to content

Commit 40a7042

Browse files
committed
Gracefully handle missing component mappings
1 parent 02f3343 commit 40a7042

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/javascript/src/models/v2/embedded-flow-v2.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ export enum EmbeddedFlowComponentType {
4747
/** Email input field with validation for email addresses. */
4848
EmailInput = 'EMAIL_INPUT',
4949

50+
/** One-time password input field for multi-factor authentication */
51+
OtpInput = 'OTP_INPUT',
52+
53+
/** Phone number input field with country code support */
54+
PhoneInput = 'PHONE_INPUT',
55+
5056
/** Text display component for labels, headings, and messages */
5157
Text = 'TEXT',
5258

packages/react/src/components/presentation/auth/AuthOptionFactory.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,9 @@ const createAuthComponentFromFlow = (
265265
}
266266

267267
default:
268-
throw new AsgardeoRuntimeError(
269-
`Unsupported component type: ${component.type}`,
270-
`${authType === 'signin' ? 'SignIn' : 'SignUp'}-UnsupportedComponentType-001`,
271-
'react',
272-
`Something went wrong while rendering the ${authType} component. Please try again later.`,
273-
);
268+
// Gracefully handle unsupported component types by returning null
269+
console.warn(`Unsupported component type: ${component.type}. Skipping render.`);
270+
return null;
274271
}
275272
};
276273

0 commit comments

Comments
 (0)