@@ -222,7 +222,7 @@ const SignIn: FC<SignInProps> = ({
222222 // State management for the flow
223223 const [ components , setComponents ] = useState < EmbeddedFlowComponent [ ] > ( [ ] ) ;
224224 const [ additionalData , setAdditionalData ] = useState < Record < string , any > > ( { } ) ;
225- const [ currentFlowId , setCurrentFlowId ] = useState < string | null > ( null ) ;
225+ const [ currentFlowExecId , setCurrentFlowExecId ] = useState < string | null > ( null ) ;
226226 const [ isFlowInitialized , setIsFlowInitialized ] = useState ( false ) ;
227227 const [ flowError , setFlowError ] = useState < Error | null > ( null ) ;
228228 const [ isSubmitting , setIsSubmitting ] = useState ( false ) ;
@@ -239,11 +239,11 @@ const SignIn: FC<SignInProps> = ({
239239 const oauthCodeProcessedRef : any = useRef ( false ) ;
240240 const passkeyProcessedRef : any = useRef ( false ) ;
241241 /**
242- * Sets flowId between sessionStorage and state.
242+ * Sets flowExecId between sessionStorage and state.
243243 * This ensures both are always in sync.
244244 */
245- const setFlowId = ( flowExecId : string | null ) : void => {
246- setCurrentFlowId ( flowExecId ) ;
245+ const setFlowExecId = ( flowExecId : string | null ) : void => {
246+ setCurrentFlowExecId ( flowExecId ) ;
247247 if ( flowExecId ) {
248248 sessionStorage . setItem ( 'asgardeo_flow_id' , flowExecId ) ;
249249 } else {
@@ -255,7 +255,7 @@ const SignIn: FC<SignInProps> = ({
255255 * Clear all flow-related storage and state.
256256 */
257257 const clearFlowState = ( ) : void => {
258- setFlowId ( null ) ;
258+ setFlowExecId ( null ) ;
259259 setIsFlowInitialized ( false ) ;
260260 sessionStorage . removeItem ( 'asgardeo_auth_id' ) ;
261261 setIsTimeoutDisabled ( false ) ;
@@ -350,7 +350,7 @@ const SignIn: FC<SignInProps> = ({
350350
351351 if ( redirectURL && window ?. location ) {
352352 if ( response . flowExecId ) {
353- setFlowId ( response . flowExecId ) ;
353+ setFlowExecId ( response . flowExecId ) ;
354354 }
355355
356356 const urlParams : any = getUrlParams ( ) ;
@@ -365,7 +365,7 @@ const SignIn: FC<SignInProps> = ({
365365
366366 /**
367367 * Initialize the authentication flow.
368- * Priority: flowId > applicationId (from context) > applicationId (from URL)
368+ * Priority: flowExecId > applicationId (from context) > applicationId (from URL)
369369 */
370370 const initializeFlow = async ( ) : Promise < void > => {
371371 const urlParams : any = getUrlParams ( ) ;
@@ -408,7 +408,7 @@ const SignIn: FC<SignInProps> = ({
408408 }
409409
410410 const {
411- flowExecId : normalizedFlowId ,
411+ flowExecId : normalizedFlowExecId ,
412412 components : normalizedComponents ,
413413 additionalData : normalizedAdditionalData ,
414414 } = normalizeFlowResponse (
@@ -420,13 +420,13 @@ const SignIn: FC<SignInProps> = ({
420420 meta ,
421421 ) ;
422422
423- if ( normalizedFlowId && normalizedComponents ) {
424- setFlowId ( normalizedFlowId ) ;
423+ if ( normalizedFlowExecId && normalizedComponents ) {
424+ setFlowExecId ( normalizedFlowExecId ) ;
425425 setComponents ( normalizedComponents ) ;
426426 setAdditionalData ( normalizedAdditionalData ?? { } ) ;
427427 setIsFlowInitialized ( true ) ;
428428 setIsTimeoutDisabled ( false ) ;
429- // Clean up flowId from URL after setting it in state
429+ // Clean up flowExecId from URL after setting it in state
430430 cleanupFlowUrlParams ( ) ;
431431 }
432432 } catch ( error ) {
@@ -468,7 +468,7 @@ const SignIn: FC<SignInProps> = ({
468468 ! isLoading &&
469469 ! isFlowInitialized &&
470470 ! initializationAttemptedRef . current &&
471- ! currentFlowId &&
471+ ! currentFlowExecId &&
472472 ! currentUrlParams . code &&
473473 ! currentUrlParams . state &&
474474 ! isSubmitting &&
@@ -477,7 +477,7 @@ const SignIn: FC<SignInProps> = ({
477477 initializationAttemptedRef . current = true ;
478478 initializeFlow ( ) ;
479479 }
480- } , [ isInitialized , isLoading , isFlowInitialized , currentFlowId ] ) ;
480+ } , [ isInitialized , isLoading , isFlowInitialized , currentFlowExecId ] ) ;
481481
482482 /**
483483 * Handle step timeout if configured in additionalData.
@@ -513,10 +513,10 @@ const SignIn: FC<SignInProps> = ({
513513 * Handle form submission from BaseSignIn or render props.
514514 */
515515 const handleSubmit = async ( payload : EmbeddedSignInFlowRequestV2 ) : Promise < void > => {
516- // Use flowExecId from payload if available, otherwise fall back to currentFlowId
517- const effectiveFlowId : any = payload . flowExecId || currentFlowId ;
516+ // Use flowExecId from payload if available, otherwise fall back to currentFlowExecId
517+ const effectiveFlowExecId : any = payload . flowExecId || currentFlowExecId ;
518518
519- if ( ! effectiveFlowId ) {
519+ if ( ! effectiveFlowExecId ) {
520520 throw new Error ( 'No active flow ID' ) ;
521521 }
522522
@@ -592,7 +592,7 @@ const SignIn: FC<SignInProps> = ({
592592 setFlowError ( null ) ;
593593
594594 const response : EmbeddedSignInFlowResponseV2 = ( await signIn ( {
595- flowExecId : effectiveFlowId ,
595+ flowExecId : effectiveFlowExecId ,
596596 ...payload ,
597597 inputs : processedInputs ,
598598 } ) ) as EmbeddedSignInFlowResponseV2 ;
@@ -605,7 +605,7 @@ const SignIn: FC<SignInProps> = ({
605605 response . data ?. additionalData ?. [ 'passkeyCreationOptions' ]
606606 ) {
607607 const { passkeyChallenge, passkeyCreationOptions } : any = response . data . additionalData ;
608- const effectiveFlowIdForPasskey : any = response . flowExecId || effectiveFlowId ;
608+ const effectiveFlowExecIdForPasskey : any = response . flowExecId || effectiveFlowExecId ;
609609
610610 // Reset passkey processed ref to allow processing
611611 passkeyProcessedRef . current = false ;
@@ -616,7 +616,7 @@ const SignIn: FC<SignInProps> = ({
616616 challenge : passkeyChallenge ,
617617 creationOptions : passkeyCreationOptions ,
618618 error : null ,
619- flowExecId : effectiveFlowIdForPasskey ,
619+ flowExecId : effectiveFlowExecIdForPasskey ,
620620 isActive : true ,
621621 } ) ;
622622 setIsSubmitting ( false ) ;
@@ -625,7 +625,7 @@ const SignIn: FC<SignInProps> = ({
625625 }
626626
627627 const {
628- flowExecId : normalizedFlowId ,
628+ flowExecId : normalizedFlowExecId ,
629629 components : normalizedComponents ,
630630 additionalData : normalizedAdditionalData ,
631631 } = normalizeFlowResponse (
@@ -659,7 +659,7 @@ const SignIn: FC<SignInProps> = ({
659659 setIsSubmitting ( false ) ;
660660
661661 // Clear all OAuth-related storage on successful completion
662- setFlowId ( null ) ;
662+ setFlowExecId ( null ) ;
663663 setIsFlowInitialized ( false ) ;
664664 sessionStorage . removeItem ( 'asgardeo_flow_id' ) ;
665665 sessionStorage . removeItem ( 'asgardeo_auth_id' ) ;
@@ -681,15 +681,15 @@ const SignIn: FC<SignInProps> = ({
681681 return ;
682682 }
683683
684- // Update flowId if response contains a new one
685- if ( normalizedFlowId && normalizedComponents ) {
686- setFlowId ( normalizedFlowId ) ;
684+ // Update flowExecId if response contains a new one
685+ if ( normalizedFlowExecId && normalizedComponents ) {
686+ setFlowExecId ( normalizedFlowExecId ) ;
687687 setComponents ( normalizedComponents ) ;
688688 setAdditionalData ( normalizedAdditionalData ?? { } ) ;
689689 setIsTimeoutDisabled ( false ) ;
690690 // Ensure flow is marked as initialized when we have components
691691 setIsFlowInitialized ( true ) ;
692- // Clean up flowId from URL after setting it in state
692+ // Clean up flowExecId from URL after setting it in state
693693 cleanupFlowUrlParams ( ) ;
694694
695695 // Display failure reason from INCOMPLETE response
@@ -719,7 +719,7 @@ const SignIn: FC<SignInProps> = ({
719719 } ;
720720
721721 useOAuthCallback ( {
722- currentFlowExecId : currentFlowId ,
722+ currentFlowExecId : currentFlowExecId ,
723723 isInitialized : isInitialized && ! isLoading ,
724724 isSubmitting,
725725 onError : ( err : any ) => {
@@ -728,7 +728,7 @@ const SignIn: FC<SignInProps> = ({
728728 } ,
729729 onSubmit : async ( payload : any ) => handleSubmit ( { flowExecId : payload . flowExecId , inputs : payload . inputs } ) ,
730730 processedRef : oauthCodeProcessedRef ,
731- setFlowId ,
731+ setFlowExecId : setFlowExecId ,
732732 } ) ;
733733
734734 /**
0 commit comments