Skip to content
Open
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
7 changes: 7 additions & 0 deletions .changeset/cold-turtles-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@asgardeo/javascript': minor
'@asgardeo/react': minor
'@asgardeo/vue': minor
---

Rename flowId in flow execution to executionId
4 changes: 2 additions & 2 deletions packages/javascript/src/api/v2/executeEmbeddedSignInFlowV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const executeEmbeddedSignInFlowV2 = async ({
// `verbose: true` is required to get the `meta` field in the response that includes component details.
// Add verbose:true if:
// 1. payload contains only applicationId and flowType
// 2. payload contains only flowId
// 2. payload contains only executionId
const hasOnlyAppIdAndFlowType: boolean =
typeof cleanPayload === 'object' &&
cleanPayload !== null &&
Expand All @@ -61,7 +61,7 @@ const executeEmbeddedSignInFlowV2 = async ({
const hasOnlyFlowId: boolean =
typeof cleanPayload === 'object' &&
cleanPayload !== null &&
'flowId' in cleanPayload &&
'executionId' in cleanPayload &&
Object.keys(cleanPayload).length === 1;

const requestPayload: Record<string, unknown> =
Expand Down
4 changes: 2 additions & 2 deletions packages/javascript/src/api/v2/executeEmbeddedSignUpFlowV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const executeEmbeddedSignUpFlowV2 = async ({
// `verbose: true` is required to get the `meta` field in the response that includes component details.
// Add verbose:true if:
// 1. payload contains only applicationId and flowType
// 2. payload contains only flowId
// 2. payload contains only executionId
const hasOnlyAppIdAndFlowType: boolean =
typeof cleanPayload === 'object' &&
cleanPayload !== null &&
Expand All @@ -61,7 +61,7 @@ const executeEmbeddedSignUpFlowV2 = async ({
const hasOnlyFlowId: boolean =
typeof cleanPayload === 'object' &&
cleanPayload !== null &&
'flowId' in cleanPayload &&
'executionId' in cleanPayload &&
Object.keys(cleanPayload).length === 1;

const requestPayload: Record<string, unknown> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ export interface EmbeddedUserOnboardingFlowResponse {
};

/**
* Reason for failure if flowStatus is ERROR.
* Unique identifier for the flow execution.
*/
failureReason?: string;
executionId: string;

/**
* Unique identifier for the flow execution.
* Reason for failure if flowStatus is ERROR.
*/
flowId: string;
failureReason?: string;

/**
* Current status of the flow.
Expand Down Expand Up @@ -88,7 +88,7 @@ export interface EmbeddedUserOnboardingFlowResponse {
* const response = await executeEmbeddedUserOnboardingFlowV2({
* baseUrl: "https://api.thunder.io",
* payload: {
* flowId: "flow-id-from-url",
* executionId: "flow-id-from-url",
* inputs: { inviteToken: "token-from-url" }
* }
* });
Expand Down Expand Up @@ -128,10 +128,13 @@ const executeEmbeddedUserOnboardingFlowV2 = async ({
const hasOnlyFlowId: boolean =
typeof cleanPayload === 'object' &&
cleanPayload !== null &&
'flowId' in cleanPayload &&
'executionId' in cleanPayload &&
Object.keys(cleanPayload).length === 1;
const hasFlowIdWithInputs: boolean =
typeof cleanPayload === 'object' && cleanPayload !== null && 'flowId' in cleanPayload && 'inputs' in cleanPayload;
typeof cleanPayload === 'object' &&
cleanPayload !== null &&
'executionId' in cleanPayload &&
'inputs' in cleanPayload;

// Add verbose for initial requests and when continuing with inputs
const requestPayload: Record<string, unknown> =
Expand Down
20 changes: 10 additions & 10 deletions packages/javascript/src/models/v2/embedded-signin-flow-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export interface ExtendedEmbeddedSignInFlowResponse {
* @example
* ```typescript
* const response: EmbeddedSignInFlowResponse = {
* flowId: "flow_12345",
* executionId: "flow_12345",
* flowStatus: EmbeddedSignInFlowStatus.Incomplete,
* type: EmbeddedSignInFlowType.View,
* data: {
Expand Down Expand Up @@ -197,16 +197,16 @@ export interface EmbeddedSignInFlowResponse extends ExtendedEmbeddedSignInFlowRe
};

/**
* Optional reason for flow failure in case of an error.
* Provides additional context when flowStatus is set to ERROR.
* Unique identifier for this specific flow instance.
* Used to maintain state across multiple API calls during the authentication process.
*/
failureReason?: string;
executionId: string;

/**
* Unique identifier for this specific flow instance.
* Used to maintain state across multiple API calls during the authentication process.
* Optional reason for flow failure in case of an error.
* Provides additional context when flowStatus is set to ERROR.
*/
flowId: string;
failureReason?: string;

/**
* Current status of the sign-in flow.
Expand Down Expand Up @@ -292,14 +292,14 @@ export type EmbeddedSignInFlowInitiateRequest = {
* Request payload for executing steps in Asgardeo embedded sign-in flows.
*
* This interface defines the structure for subsequent requests after flow initiation.
* It supports both continuing existing flows (with flowId) and submitting user
* It supports both continuing existing flows (with executionId) and submitting user
* input data collected from the rendered components.
*
* @example
* ```typescript
* // Continue existing flow with user input
* const stepRequest: EmbeddedSignInFlowRequest = {
* flowId: "flow_12345",
* executionId: "flow_12345",
* action: "action_001",
* inputs: {
* username: "user@example.com",
Expand Down Expand Up @@ -327,7 +327,7 @@ export interface EmbeddedSignInFlowRequest extends Partial<EmbeddedSignInFlowIni
* Identifier of the flow instance to continue.
* Required when submitting data for an existing flow.
*/
flowId?: string;
executionId?: string;

/**
* User input data collected from the form components.
Expand Down
22 changes: 11 additions & 11 deletions packages/javascript/src/models/v2/embedded-signup-flow-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ export interface EmbeddedSignUpFlowResponse extends ExtendedEmbeddedSignUpFlowRe
};

/**
* Optional reason for flow failure in case of an error.
* Provides additional context when flowStatus is set to ERROR.
* Unique identifier for this sign-up flow instance.
*/
failureReason?: string;
executionId: string;

/**
* Unique identifier for this sign-up flow instance.
* Optional reason for flow failure in case of an error.
* Provides additional context when flowStatus is set to ERROR.
*/
flowId: string;
failureReason?: string;

/**
* Current status of the sign-up flow.
Expand Down Expand Up @@ -210,7 +210,7 @@ export type EmbeddedSignUpFlowInitiateRequest = {
*/
export interface EmbeddedSignUpFlowRequest extends Partial<EmbeddedSignUpFlowInitiateRequest> {
action?: string;
flowId?: string;
executionId?: string;
inputs?: Record<string, any>;
}

Expand All @@ -223,7 +223,7 @@ export interface EmbeddedSignUpFlowRequest extends Partial<EmbeddedSignUpFlowIni
*
* **Key Differences from AsgardeoV1:**
* - Uses `failureReason` instead of `message`/`description` for error details
* - Maintains flow context with `flowId` for tracking failed operations
* - Maintains flow context with `executionId` for tracking failed operations
* - Uses structured `flowStatus` enum instead of generic error codes
* - Provides empty `data` object for consistency with success responses
*
Expand All @@ -236,7 +236,7 @@ export interface EmbeddedSignUpFlowRequest extends Partial<EmbeddedSignUpFlowIni
* ```typescript
* // Typical Asgardeo error response
* const errorResponse: EmbeddedSignUpFlowErrorResponse = {
* flowId: "0ccfeaf9-18b3-43a5-bcc1-07d863dcb2c0",
* executionId: "0ccfeaf9-18b3-43a5-bcc1-07d863dcb2c0",
* flowStatus: EmbeddedSignUpFlowStatus.Error,
* data: {},
* failureReason: "User already exists with the provided username."
Expand Down Expand Up @@ -270,14 +270,14 @@ export interface EmbeddedSignUpFlowErrorResponse {
* Unlike generic error codes, this provides contextual information
* that helps users understand and resolve the issue.
*/
failureReason: string;

/**
* Unique identifier for the sign-up flow instance.
* This ID is used to track the flow state and correlate error responses
* with the specific sign-up attempt that failed.
*/
flowId: string;
executionId: string;

failureReason: string;

/**
* Status of the sign-up flow, which will be `EmbeddedSignUpFlowStatus.Error`
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/AsgardeoReactClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
typeof arg1 === 'object' &&
arg1 !== null &&
!isEmpty(arg1) &&
('flowId' in arg1 || 'applicationId' in arg1)
('executionId' in arg1 || 'applicationId' in arg1)
) {
const authIdFromUrl: string = new URL(window.location.href).searchParams.get('authId');
const authIdFromStorage: string = sessionStorage.getItem('asgardeo_auth_id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface AcceptInviteProps {
* Flow ID from the invite link.
* If not provided, will be extracted from URL query parameters.
*/
flowId?: string;
executionId?: string;

/**
* Invite token from the invite link.
Expand Down Expand Up @@ -101,14 +101,14 @@ export interface AcceptInviteProps {
/**
* Helper to extract query parameters from URL.
*/
const getUrlParams = (): {flowId?: string; inviteToken?: string} => {
const getUrlParams = (): {executionId?: string; inviteToken?: string} => {
if (typeof window === 'undefined') {
return {};
}

const params: any = new URLSearchParams(window.location.search);
return {
flowId: params.get('flowId') || undefined,
executionId: params.get('executionId') || undefined,
inviteToken: params.get('inviteToken') || undefined,
};
};
Expand All @@ -118,7 +118,7 @@ const getUrlParams = (): {flowId?: string; inviteToken?: string} => {
*
* This component is designed for end users accessing the thunder-gate app via an invite link.
* It automatically:
* 1. Extracts flowId and inviteToken from URL query parameters
* 1. Extracts executionId and inviteToken from URL query parameters
* 2. Validates the invite token with the backend
* 3. Displays the password form if token is valid
* 4. Completes the accept invite when password is set
Expand All @@ -127,7 +127,7 @@ const getUrlParams = (): {flowId?: string; inviteToken?: string} => {
* ```tsx
* import { AcceptInvite } from '@asgardeo/react';
*
* // URL: /invite?flowId=xxx&inviteToken=yyy
* // URL: /invite?executionId=xxx&inviteToken=yyy
*
* const AcceptInvitePage = () => {
* return (
Expand All @@ -153,7 +153,7 @@ const getUrlParams = (): {flowId?: string; inviteToken?: string} => {
*/
const AcceptInvite: FC<AcceptInviteProps> = ({
baseUrl,
flowId: flowIdProp,
executionId: executionIdProp,
inviteToken: inviteTokenProp,
onComplete,
onError,
Expand All @@ -167,9 +167,9 @@ const AcceptInvite: FC<AcceptInviteProps> = ({
showSubtitle = true,
}: AcceptInviteProps): ReactElement => {
// Extract from URL if not provided as props
const {flowId: urlFlowId, inviteToken: urlInviteToken} = useMemo(() => getUrlParams(), []);
const {executionId: urlExecutionId, inviteToken: urlInviteToken} = useMemo(() => getUrlParams(), []);

const flowId: any = flowIdProp || urlFlowId;
const executionId: any = executionIdProp || urlExecutionId;
const inviteToken: any = inviteTokenProp || urlInviteToken;

// Determine base URL
Expand Down Expand Up @@ -211,7 +211,7 @@ const AcceptInvite: FC<AcceptInviteProps> = ({

return (
<BaseAcceptInvite
flowId={flowId}
executionId={executionId}
inviteToken={inviteToken}
onSubmit={handleSubmit}
onComplete={onComplete}
Expand Down
Loading
Loading