diff --git a/.changeset/twelve-moons-scream.md b/.changeset/twelve-moons-scream.md new file mode 100644 index 000000000..bd5265017 --- /dev/null +++ b/.changeset/twelve-moons-scream.md @@ -0,0 +1,5 @@ +--- +'@asgardeo/react': patch +--- + +Modify timer text to use the label field diff --git a/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx b/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx index 371abb70f..cc3426508 100644 --- a/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx +++ b/packages/react/src/components/presentation/auth/AuthOptionFactory.tsx @@ -498,8 +498,7 @@ const createAuthComponentFromFlow = ( } case EmbeddedFlowComponentType.Timer: { - const timerConfig: {text?: string} = (component as any).config || {}; - const textTemplate: string = timerConfig.text || 'Time remaining: {time}'; + const textTemplate: string = resolve((component as any).label) || 'Time remaining: {time}'; const timeoutMs: number = Number(options.additionalData?.['stepTimeout']) || 0; const expiresIn: number = timeoutMs > 0 ? Math.max(0, Math.floor((timeoutMs - Date.now()) / 1000)) : 0;