Skip to content

Commit 09256e9

Browse files
committed
Fix action id
1 parent b09f645 commit 09256e9

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.changeset/upset-boxes-allow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@asgardeo/react': patch
3+
---
4+
5+
Fix action id

packages/react/src/components/presentation/SignUp/BaseSignUp.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
EmbeddedFlowResponseType,
2525
withVendorCSSClassPrefix,
2626
AsgardeoAPIError,
27+
Platform,
2728
} from '@asgardeo/browser';
2829
import {cx} from '@emotion/css';
2930
import {FC, ReactElement, ReactNode, useEffect, useState, useCallback, useRef} from 'react';
@@ -34,6 +35,7 @@ import useFlow from '../../../contexts/Flow/useFlow';
3435
import {useForm, FormField} from '../../../hooks/useForm';
3536
import useTranslation from '../../../hooks/useTranslation';
3637
import useTheme from '../../../contexts/Theme/useTheme';
38+
import useAsgardeo from '../../../contexts/Asgardeo/useAsgardeo';
3739
import Alert from '../../primitives/Alert/Alert';
3840
import Card, {CardProps} from '../../primitives/Card/Card';
3941
import Logo from '../../primitives/Logo/Logo';
@@ -309,6 +311,7 @@ const BaseSignUpContent: FC<BaseSignUpProps> = ({
309311
const {theme, colorScheme} = useTheme();
310312
const {t} = useTranslation();
311313
const {subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages} = useFlow();
314+
const {platform} = useAsgardeo();
312315
const styles = useStyles(theme, colorScheme);
313316

314317
/**
@@ -484,11 +487,16 @@ const BaseSignUpContent: FC<BaseSignUpProps> = ({
484487
});
485488
}
486489

490+
// For AsgardeoV2 platform, use actionId from component.config, otherwise use component.id
491+
const actionId = platform === Platform.AsgardeoV2
492+
? component.config?.actionId
493+
: component.id;
494+
487495
const payload: EmbeddedFlowExecuteRequestPayload = {
488496
...(currentFlow.flowId && {flowId: currentFlow.flowId}),
489497
flowType: (currentFlow as any).flowType || 'REGISTRATION',
490498
inputs: filteredInputs,
491-
actionId: component.id,
499+
...(actionId && { actionId: actionId as string }),
492500
} as any;
493501

494502
const rawResponse = await onSubmit(payload);

0 commit comments

Comments
 (0)