Skip to content

[3828] Added reset form to clear formvalues#25

Open
zesu22 wants to merge 2 commits into
thunder-id:mainfrom
Infosys:bug/3828
Open

[3828] Added reset form to clear formvalues#25
zesu22 wants to merge 2 commits into
thunder-id:mainfrom
Infosys:bug/3828

Conversation

@zesu22

@zesu22 zesu22 commented Jul 10, 2026

Copy link
Copy Markdown

Purpose

In certain flows (such as utilizing the flow graph to navigate backward to a previous node), two core issues occurred due to missing form-reset capabilities:

  1. Navigating backward inadvertently behaved as a form submission, marking the current inputs as submitted.
  2. If a user subsequently tried to return to that same node again, the input fields would render completely empty because the component state considered the form already submitted and cleared.

This PR introduces explicit form-reset handling and refines button behavior to ensure that backward navigation or cancellation actions do not trigger accidental form submissions, preserving the form state for subsequent visits.

Summary

Introduced a resetForm mechanism to allow authentication components to explicitly reset their internal form state, and exposed it via context to support custom renderers. Additionally, enhanced button behavior by expanding supported event types (reset, cancel, back) with proper underlying HTML button type mappings to prevent accidental form submissions.

Key Changes

  • Enhanced Button Event Handling & Form Protection:

    • Expanded supported button event actions beyond just submit and trigger to now include reset, cancel, and back. (The core UI and interface for these were already present).
    • Mapped these event actions to their native HTML button types: submit maps to type="submit", reset maps to type="reset", and all other actions (like cancel or back) map to type="button".
    • This prevents non-submit buttons from accidentally triggering form submission. Only the submit action will process and submit actual form values, while other types simply handle their action or reset the form.
    • Backward Compatibility: If no explicit event action is defined, it defaults to submit to ensure existing implementations don't break.
  • Factory Updates (AuthOptionFactory):

    • Added resetForm to createAuthComponentFromFlow.
    • Because this core method is shared, the updates extend to renderSignInComponents, renderSignupComponent, renderRecoveryComponents, and renderInviteUserComponents.
  • Context Exposure:

    • Added resetForm to ComponentRenderContext, making it accessible outside the factory and available for custom renderer components (e.g., inside an onSubmit handler).
  • Base Component Integration:

    • Updated the following base components to accommodate and pass through the new resetForm functionality:
      • BaseSignIn / BaseSignup
      • BaseRecovery
      • BaseAcceptInvite / BaseInviteUser
  • Cross-Framework Parity:

    • These changes were primarily implemented for the React packages, with parallel implementations added to the Vue packages to maintain feature alignment.

Related Issues

  • N/A

Related PRs

  • N/A

Checklist

  • [ x] Followed the contribution guidelines.
  • [ x] Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • [ x] Followed secure coding standards in WSO2 Secure Coding Guidelines
  • [x ] Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • New Features

    • Added form reset support across sign-in, sign-up, recovery, accept-invite, and invite-user flows.
    • Custom-rendered auth/invite components can now trigger a full form-state reset (values, errors, touched state, and related API/form validity).
  • Behavior Updates

    • Updated embedded flow action handling so non-submit actions reset the form and submit with empty data, preventing stale submissions.
    • Consistent reset behavior is now threaded through container and nested component rendering in both React and Vue.
  • Tests

    • Updated auth option factory tests to match the new render callback signature.

Signed-off-by: Zeeshan Mehboob <zeeshan.mehboob@infosys.com>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Authentication component renderers now receive form-reset callbacks across shared contracts and React/Vue pipelines. Embedded non-submit actions reset local form state and submit empty data, while submit actions continue submitting collected form data.

Changes

Auth form reset flow

Layer / File(s) Summary
Renderer reset contract
packages/javascript/src/models/extensions/components.ts, packages/react/src/contexts/ComponentRenderer/ComponentRendererContext.ts, packages/react/src/components/presentation/auth/AuthOptionFactory.tsx, packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts
Render contexts and auth renderer entry points accept and propagate resetForm callbacks through nested components.
React action handling
packages/react/src/components/presentation/auth/AuthOptionFactory.tsx
Embedded action buttons derive their HTML type from the flow event; submit actions pass form data, while other actions reset the form and submit empty data.
React form reset wiring
packages/react/src/components/presentation/auth/{AcceptInvite,InviteUser,Recovery,SignIn,SignUp}/*.tsx, packages/react/src/components/presentation/auth/__tests__/AuthOptionFactory.test.tsx
React auth components create or obtain reset callbacks and pass them to renderer entry points; the factory test helper supplies the new argument.
Vue form reset wiring and actions
packages/vue/src/components/auth/sign-in/*, packages/vue/src/components/auth/sign-up/*, packages/vue/src/components/presentation/{accept-invite,invite-user}/*
Vue factories implement reset behavior for non-submit actions, and base components clear their form state before passing reset callbacks into renderers.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AuthForm
  participant ComponentRenderer
  participant EmbeddedAction
  participant SubmitHandler
  AuthForm->>ComponentRenderer: provide resetForm
  ComponentRenderer->>EmbeddedAction: render action with resetForm
  EmbeddedAction->>AuthForm: reset on non-submit action
  EmbeddedAction->>SubmitHandler: submit form data or empty data
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title reflects the main change: adding reset-form support to clear form values.
Description check ✅ Passed The description covers Purpose, Summary, Key Changes, related items, checklist, and security sections, with only non-critical checklist items left unfilled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
packages/react/src/components/presentation/auth/AuthOptionFactory.tsx (1)

418-439: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Prevent native form submission for Block submit buttons. The Block flow renders a real <form> with no onSubmit/preventDefault, and this button now uses type="submit" for submit events. Clicking it will trigger the browser’s form submit in addition to handleClick, which can reload the page and drop SPA/auth state.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/react/src/components/presentation/auth/AuthOptionFactory.tsx` around
lines 418 - 439, Prevent native form submission for Block-flow buttons by
ensuring the Button rendered in the relevant auth option path does not use
submit semantics when the surrounding form lacks submit handling. Update the
type selection associated with handleClick/buttonType so Block buttons use
type="button", while preserving submit behavior only where explicitly handled.
packages/react/src/components/presentation/auth/SignIn/BaseSignIn.tsx (1)

351-361: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

resetForm doesn't clear apiError/flow messages, unlike the Vue counterpart.

resetForm here is just form.reset(), which only touches useForm's internal state (values/touched/errors). apiError (component-level useState) and flow messages are untouched. Compare with Vue's BaseSignIn.ts resetForm (lines 293-304), which explicitly does apiError.value = null; clearMessages(); in addition to resetting field values. As a result, clicking Cancel/Back in React will leave a stale error message visible, while Vue correctly clears it.

Proposed fix
+  const resetFormAndErrors = useCallback(() => {
+    resetForm();
+    setApiError(null);
+    clearMessages();
+  }, [resetForm, clearMessages]);

Then pass resetFormAndErrors instead of resetForm to renderSignInComponents.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/react/src/components/presentation/auth/SignIn/BaseSignIn.tsx` around
lines 351 - 361, Update BaseSignIn’s reset handling so it clears both form state
and component-level errors/flow messages: define a resetFormAndErrors handler
that calls resetForm, sets apiError to null, and invokes clearMessages, then
pass this handler to renderSignInComponents instead of resetForm.
packages/react/src/components/presentation/auth/SignUp/BaseSignUp.tsx (1)

961-982: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Type form properly to fix the unsafe-argument lint error; resetForm also skips apiError/messages.

Static analysis flags resetForm as any being passed where () => void is expected (line 970), because form is declared as const form: any = useForm<Record<string, string>>(...) (line 469 area) instead of ReturnType<typeof useForm> as done in BaseSignIn.tsx. Typing it properly resolves the lint error and restores type safety for the whole destructured object.

Separately, resetForm (i.e. form.reset) won't clear apiError/flow messages, the same gap flagged in BaseSignIn.tsx — worth addressing together since this file also now feeds resetForm into the Cancel/Back button flow.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/react/src/components/presentation/auth/SignUp/BaseSignUp.tsx` around
lines 961 - 982, Type the form instance in BaseSignUp using the return type of
useForm instead of any, so the destructured resetForm and related values passed
by renderComponents are type-safe. Update the reset flow used by
renderComponents and the Cancel/Back actions to also clear apiError and flow
messages, matching the behavior in BaseSignIn.

Source: Linters/SAST tools

packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts (1)

291-312: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Prevent the generic submit button from triggering a native form submit. Button forwards type to a real <button>, and the enclosing <form> has no submit guard, so the default type="submit" path can reload the page instead of staying in Vue's click flow. Add a form submit preventer or stop the default action in the button handler.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts` around
lines 291 - 312, Prevent the generic submit button from causing a native form
submission by updating the button handling in AuthOptionFactoryCore,
specifically the Button configuration around handleClick and buttonType. Add a
form-level submit preventer or ensure the click handler calls preventDefault
before continuing the Vue flow, while preserving intended button types and
existing validation behavior.
🧹 Nitpick comments (4)
packages/vue/src/components/presentation/invite-user/BaseInviteUser.ts (1)

314-338: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: resetForm and resetFlow share partial reset logic; consider consolidating.

resetFlow (lines 314-325) already clears formValues/formErrors/touchedFields/apiError as part of a larger reset, and the new resetForm (327-338) duplicates that subset plus isFormValid. Also identical to BaseAcceptInvite.ts's resetForm. Not urgent given the small size of each block, but a shared helper (e.g. resetFormState()) would reduce drift risk if reset semantics change later.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vue/src/components/presentation/invite-user/BaseInviteUser.ts`
around lines 314 - 338, Consolidate the duplicated form-state reset logic used
by resetFlow and resetForm in BaseInviteUser.ts. Introduce a shared
resetFormState helper for formValues, formErrors, touchedFields, and apiError,
then call it from both resetFlow and resetForm while preserving resetForm’s
isFormValid behavior; align with the equivalent resetForm implementation in
BaseAcceptInvite.ts where appropriate.
packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts (1)

206-214: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Type buttonTypeEnum explicitly to resolve unsafe-assignment/member-access lint errors.

ESLint flags unsafe member access on EmbeddedFlowEventType.Submit/Reset/Cancel/Trigger/Back and an unsafe assignment for buttonType, plus a prefer-nullish-coalescing hint on || 'submit'. Declaring buttonTypeEnum with an explicit Record<string, HTMLButtonElement['type']> type resolves the assignment error, and switching to ?? addresses the coalescing hint.

Proposed fix
-      const buttonTypeEnum = {
+      const buttonTypeEnum: Record<string, HTMLButtonElement['type']> = {
         [EmbeddedFlowEventType.Submit]: 'submit',
         [EmbeddedFlowEventType.Reset]: 'reset',
         [EmbeddedFlowEventType.Cancel]: 'button',
         [EmbeddedFlowEventType.Trigger]: 'button',
         [EmbeddedFlowEventType.Back]: 'button',
       };
-      const buttonType: HTMLButtonElement['type'] = buttonTypeEnum[eventType.toUpperCase()] || 'submit';
+      const buttonType: HTMLButtonElement['type'] = buttonTypeEnum[eventType.toUpperCase()] ?? 'submit';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts` around
lines 206 - 214, Explicitly type the buttonTypeEnum mapping in the button-type
selection logic as Record<string, HTMLButtonElement['type']> to eliminate unsafe
member access and assignment lint errors, then replace the || 'submit' fallback
with ?? 'submit' while preserving the existing event mappings.

Source: Linters/SAST tools

packages/vue/src/components/auth/sign-up/BaseSignUp.ts (1)

276-292: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate field-rebuilding logic with setupFormFields; minor nullish-coalescing fix available.

This mirrors setupFormFields (lines 226-236) almost exactly (rebuild values from extractFormFields, reset touched/errors/validity), differing only in also clearing apiError. Consider having resetForm call/share logic with setupFormFields to avoid drift. Separately, static analysis flags props.components || [] (line 281) for prefer-nullish-coalescing; swapping to ?? is a safe, trivial fix.

Suggested fix for the coalescing hint
-      const fields: FieldDefinition[] = extractFormFields(props.components || []);
+      const fields: FieldDefinition[] = extractFormFields(props.components ?? []);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vue/src/components/auth/sign-up/BaseSignUp.ts` around lines 276 -
292, Refactor resetForm and setupFormFields to share the common field/value,
touched-state, error, and validity reset logic, while preserving resetForm’s
apiError clearing; update the shared field extraction to use nullish coalescing
(props.components ?? []) instead of ||. Use the existing resetForm and
setupFormFields symbols to locate and consolidate the duplicated behavior.

Source: Linters/SAST tools

packages/vue/src/components/auth/sign-in/BaseSignIn.ts (1)

289-305: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate field-rebuilding logic with the watch callback above.

The extractFormFields(...) → build freshValues → assign to formValues.value sequence here duplicates the watch(() => props.components, ...) callback (lines 188-200). Consider extracting a small helper (e.g. buildFreshValues(components)) used by both, so future changes to field initialization don't need to be kept in sync manually.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vue/src/components/auth/sign-in/BaseSignIn.ts` around lines 289 -
305, Extract the shared field-initialization sequence from resetForm and the
props.components watch callback into a helper such as
buildFreshValues(components). Use this helper in both locations to assign
formValues.value, while preserving resetForm’s touchedFields, submission, API
error, and message resets.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/react/src/components/presentation/auth/AuthOptionFactory.tsx`:
- Around line 308-319: Replace the `|| 'submit'` fallback in the button type
assignment within the event-type handling logic with `?? 'submit'`, preserving
the existing nullish fallback behavior and resolving the lint warning.

In
`@packages/react/src/components/presentation/auth/InviteUser/BaseInviteUser.tsx`:
- Around line 556-564: Update the `resetForm` callback in `BaseInviteUser` to
also clear the API error state and restore form validity, matching the Vue
implementation: set `apiError` to null and `isFormValid` to true alongside the
existing form state resets.

---

Outside diff comments:
In `@packages/react/src/components/presentation/auth/AuthOptionFactory.tsx`:
- Around line 418-439: Prevent native form submission for Block-flow buttons by
ensuring the Button rendered in the relevant auth option path does not use
submit semantics when the surrounding form lacks submit handling. Update the
type selection associated with handleClick/buttonType so Block buttons use
type="button", while preserving submit behavior only where explicitly handled.

In `@packages/react/src/components/presentation/auth/SignIn/BaseSignIn.tsx`:
- Around line 351-361: Update BaseSignIn’s reset handling so it clears both form
state and component-level errors/flow messages: define a resetFormAndErrors
handler that calls resetForm, sets apiError to null, and invokes clearMessages,
then pass this handler to renderSignInComponents instead of resetForm.

In `@packages/react/src/components/presentation/auth/SignUp/BaseSignUp.tsx`:
- Around line 961-982: Type the form instance in BaseSignUp using the return
type of useForm instead of any, so the destructured resetForm and related values
passed by renderComponents are type-safe. Update the reset flow used by
renderComponents and the Cancel/Back actions to also clear apiError and flow
messages, matching the behavior in BaseSignIn.

In `@packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts`:
- Around line 291-312: Prevent the generic submit button from causing a native
form submission by updating the button handling in AuthOptionFactoryCore,
specifically the Button configuration around handleClick and buttonType. Add a
form-level submit preventer or ensure the click handler calls preventDefault
before continuing the Vue flow, while preserving intended button types and
existing validation behavior.

---

Nitpick comments:
In `@packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts`:
- Around line 206-214: Explicitly type the buttonTypeEnum mapping in the
button-type selection logic as Record<string, HTMLButtonElement['type']> to
eliminate unsafe member access and assignment lint errors, then replace the ||
'submit' fallback with ?? 'submit' while preserving the existing event mappings.

In `@packages/vue/src/components/auth/sign-in/BaseSignIn.ts`:
- Around line 289-305: Extract the shared field-initialization sequence from
resetForm and the props.components watch callback into a helper such as
buildFreshValues(components). Use this helper in both locations to assign
formValues.value, while preserving resetForm’s touchedFields, submission, API
error, and message resets.

In `@packages/vue/src/components/auth/sign-up/BaseSignUp.ts`:
- Around line 276-292: Refactor resetForm and setupFormFields to share the
common field/value, touched-state, error, and validity reset logic, while
preserving resetForm’s apiError clearing; update the shared field extraction to
use nullish coalescing (props.components ?? []) instead of ||. Use the existing
resetForm and setupFormFields symbols to locate and consolidate the duplicated
behavior.

In `@packages/vue/src/components/presentation/invite-user/BaseInviteUser.ts`:
- Around line 314-338: Consolidate the duplicated form-state reset logic used by
resetFlow and resetForm in BaseInviteUser.ts. Introduce a shared resetFormState
helper for formValues, formErrors, touchedFields, and apiError, then call it
from both resetFlow and resetForm while preserving resetForm’s isFormValid
behavior; align with the equivalent resetForm implementation in
BaseAcceptInvite.ts where appropriate.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 56b1e121-b3d6-463a-a37c-b7a1c7323d2b

📥 Commits

Reviewing files that changed from the base of the PR and between a4866f0 and 4113df1.

📒 Files selected for processing (14)
  • packages/javascript/src/models/extensions/components.ts
  • packages/react/src/components/presentation/auth/AcceptInvite/BaseAcceptInvite.tsx
  • packages/react/src/components/presentation/auth/AuthOptionFactory.tsx
  • packages/react/src/components/presentation/auth/InviteUser/BaseInviteUser.tsx
  • packages/react/src/components/presentation/auth/Recovery/BaseRecovery.tsx
  • packages/react/src/components/presentation/auth/SignIn/BaseSignIn.tsx
  • packages/react/src/components/presentation/auth/SignUp/BaseSignUp.tsx
  • packages/react/src/components/presentation/auth/__tests__/AuthOptionFactory.test.tsx
  • packages/react/src/contexts/ComponentRenderer/ComponentRendererContext.ts
  • packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts
  • packages/vue/src/components/auth/sign-in/BaseSignIn.ts
  • packages/vue/src/components/auth/sign-up/BaseSignUp.ts
  • packages/vue/src/components/presentation/accept-invite/BaseAcceptInvite.ts
  • packages/vue/src/components/presentation/invite-user/BaseInviteUser.ts

Comment thread packages/react/src/components/presentation/auth/AuthOptionFactory.tsx Outdated
Signed-off-by: Zeeshan Mehboob <zeeshan.mehboob@infosys.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/react/src/components/presentation/auth/AuthOptionFactory.tsx (1)

309-319: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Normalize eventType once before branching. component.eventType can be empty, which still renders a submit button but routes the click handler through the non-submit path, resets the form, and submits {}. Reuse one normalized event value for validation, consent, and submit/reset handling. packages/react/src/components/presentation/auth/AuthOptionFactory.tsx:309-363

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/react/src/components/presentation/auth/AuthOptionFactory.tsx` around
lines 309 - 319, Normalize component.eventType once to a valid
EmbeddedFlowEventType before deriving shouldSkipValidation, button type,
validation, consent, and click handling; default empty or unknown values to
Submit so rendering and behavior remain consistent. Reuse this normalized value
throughout the relevant AuthOptionFactory logic instead of repeatedly calling
toUpperCase on the raw eventType.

Source: Linters/SAST tools

packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts (1)

204-214: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Default omitted action types to submit semantics. eventType || '' falls through to the reset path, so the fallback submit button clears the form and calls onSubmit with {}. Normalize the event to EmbeddedFlowEventType.Submit before these checks.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts` around
lines 204 - 214, The event normalization currently allows an empty or missing
event type to follow reset behavior. In the logic containing
shouldSkipValidation and buttonTypeEnum, normalize eventType to
EmbeddedFlowEventType.Submit before validation checks, action dispatch, and
button-type selection so omitted actions use submit semantics and invoke
onSubmit correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/react/src/components/presentation/auth/AuthOptionFactory.tsx`:
- Around line 309-319: Normalize component.eventType once to a valid
EmbeddedFlowEventType before deriving shouldSkipValidation, button type,
validation, consent, and click handling; default empty or unknown values to
Submit so rendering and behavior remain consistent. Reuse this normalized value
throughout the relevant AuthOptionFactory logic instead of repeatedly calling
toUpperCase on the raw eventType.

In `@packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts`:
- Around line 204-214: The event normalization currently allows an empty or
missing event type to follow reset behavior. In the logic containing
shouldSkipValidation and buttonTypeEnum, normalize eventType to
EmbeddedFlowEventType.Submit before validation checks, action dispatch, and
button-type selection so omitted actions use submit semantics and invoke
onSubmit correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c459410c-de6e-4669-93b8-2d8b009beafd

📥 Commits

Reviewing files that changed from the base of the PR and between 4113df1 and 5b79a14.

📒 Files selected for processing (3)
  • packages/react/src/components/presentation/auth/AuthOptionFactory.tsx
  • packages/react/src/components/presentation/auth/InviteUser/BaseInviteUser.tsx
  • packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react/src/components/presentation/auth/InviteUser/BaseInviteUser.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant