Description
The handleSubmit function in the v2 SignUp/SignIn embedded flow components accepts a skipValidation third parameter, but this parameter is not exposed in the TypeScript type definitions. This makes it impossible for consumers using the render props pattern to skip validation for specific actions (e.g., social login triggers that don't need form inputs).
Current Behavior
The runtime function signature supports skipValidation:
// From compiled dist/index.js (~line 11844)
const handleSubmit = async (component, data, skipValidation) => {
if (!skipValidation) {
touchAllFields();
const validation = validateForm();
if (!validation.isValid) {
return;
}
}
// ... proceed with API call
};
But the TypeScript type in BaseSignUpRenderProps only declares:
handleSubmit: (component: any, data?: Record<string, any>) => Promise<void>;
The third parameter is missing from the type, so TypeScript consumers don't know it exists and can't use it without any casting.
Expected Behavior
The type should expose the skipValidation parameter:
handleSubmit: (component: any, data?: Record<string, any>, skipValidation?: boolean) => Promise<void>;
This allows consumers to decide when validation should be skipped based on their own logic. For example, in Thunder's gate, social login trigger buttons skip validation since they don't use form inputs:
onSubmit={(action, inputs) => {
const isTrigger = action.eventType === EmbeddedFlowEventType.Trigger;
void handleSubmit(action, inputs, isTrigger);
}}
Affected Components
- v2 SignUp (
BaseSignUp) — BaseSignUpRenderProps.handleSubmit type definition
- v2 SignIn (
BaseSignIn) — equivalent render props type definition
Both have the skipValidation parameter in the runtime implementation but not in the types.
Related
Additional Context
- SDK version:
@asgardeo/react@0.23.1
- The validation-skipping logic should remain a consumer decision, not an SDK-internal assumption — there are valid cases where trigger actions may still need form validation
Description
The
handleSubmitfunction in the v2 SignUp/SignIn embedded flow components accepts askipValidationthird parameter, but this parameter is not exposed in the TypeScript type definitions. This makes it impossible for consumers using the render props pattern to skip validation for specific actions (e.g., social login triggers that don't need form inputs).Current Behavior
The runtime function signature supports
skipValidation:But the TypeScript type in
BaseSignUpRenderPropsonly declares:The third parameter is missing from the type, so TypeScript consumers don't know it exists and can't use it without
anycasting.Expected Behavior
The type should expose the
skipValidationparameter:This allows consumers to decide when validation should be skipped based on their own logic. For example, in Thunder's gate, social login trigger buttons skip validation since they don't use form inputs:
Affected Components
BaseSignUp) —BaseSignUpRenderProps.handleSubmittype definitionBaseSignIn) — equivalent render props type definitionBoth have the
skipValidationparameter in the runtime implementation but not in the types.Related
Additional Context
@asgardeo/react@0.23.1