Skip to content

refactor(blazor): use native form inputs for login credentials in UAuthLoginForm - #159

Merged
mckaragoz merged 9 commits into
CodeBeamOrg:devfrom
mckaragoz:UAuthLoginFormNativeInputSupport
Nov 10, 2026
Merged

mckaragoz merged 9 commits into
CodeBeamOrg:devfrom
mckaragoz:UAuthLoginFormNativeInputSupport

Conversation

@mckaragoz

@mckaragoz mckaragoz commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refactor UAuthLoginForm to read credentials directly from native HTML form inputs instead of Blazor component parameters.

Changes

  • Remove Identifier and Secret parameters and their hidden input fields.
  • Introduce browser-side FormData submission without passing credentials through Blazor component state or JS interop arguments.
  • Preserve TryOnly, TryAndCommit, DirectCommit, and PKCE login flows.
  • Reuse the original form for commit instead of creating hidden credential copies.
  • Update samples, documentation, and affected tests.

Motivation

Reduce unnecessary credential exposure while keeping UAuthLoginForm independent of specific UI component libraries.

Custom UI components can participate through standard HTML name attributes without requiring credential binding to the form component.

⚠️ Breaking Changes

UAuthLoginForm no longer accepts Identifier and Secret component parameters.

Credentials are now read directly from native browser form inputs instead of Blazor component bindings. This prevents credentials from being transmitted through Blazor Server's SignalR connection solely for form submission.

Migration

Before:

<UAuthLoginForm Identifier="@identifier" Secret="@password" />

After — use the built-in login form:

<UAuthLoginForm />

Or provide custom form fields:

<UAuthLoginForm>
    <input name="Identifier" autocomplete="username" />
    <input name="Secret" type="password" autocomplete="current-password" />
    <button type="submit">Sign in</button>
</UAuthLoginForm>

Important migration notes:

  • Custom credential inputs must use the exact HTML names Identifier and Secret.
  • Credential bindings are no longer required for authentication submission.
  • Credential inputs must remain enabled throughout submission. Disable the submit button instead.
  • Existing forms using the removed component parameters must be migrated.
  • UAuthLoginForm now renders a complete login form automatically when no child content is provided.

The existing submission modes (TryOnly, TryAndCommit, and DirectCommit) remain available.

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.79167% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.23%. Comparing base (848c7e0) to head (df10c2b).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
...h.Client.Blazor/Components/UAuthLoginForm.razor.cs 94.62% 1 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #159      +/-   ##
==========================================
+ Coverage   87.21%   87.23%   +0.01%     
==========================================
  Files         580      580              
  Lines       18919    18935      +16     
  Branches     2228     2227       -1     
==========================================
+ Hits        16501    16518      +17     
+ Misses       1616     1615       -1     
  Partials      802      802              
Flag Coverage Δ
framework 87.23% <94.79%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mckaragoz mckaragoz changed the title refactor(blazor): use native form inputs for login credentials refactor(blazor): use native form inputs for login credentials in UAuthLoginForm Nov 10, 2026
@mckaragoz
mckaragoz merged commit d2398b7 into CodeBeamOrg:dev Nov 10, 2026
14 checks passed
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