Skip to content

#900#993

Merged
garronej merged 1 commit intomainfrom
issue_990
Feb 7, 2026
Merged

#900#993
garronej merged 1 commit intomainfrom
issue_990

Conversation

@garronej
Copy link
Copy Markdown
Collaborator

@garronej garronej commented Feb 7, 2026

Summary by CodeRabbit

  • New Features

    • Added support for passkey conditional authentication UI.
    • Enhanced username input autofill with WebAuthn-aware hints.
  • Chores

    • Updated login UI dependency reference.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 7, 2026

📝 Walkthrough

Walkthrough

The changes introduce WebAuthn conditional UI support across multiple login pages by adding an enableWebAuthnConditionalUI feature flag, expanding internationalization keys, importing passkey authentication initialization, refactoring input serialization with JSON.stringify, and implementing one-time event listeners. Additionally, a login UI zip URL constant is updated to a new commit hash.

Changes

Cohort / File(s) Summary
Constants Update
scripts/shared/constants.ts
Updated KEYCLOAKIFY_LOGIN_UI_ZIP_URL from commit 3f51a6fe to 7eb5c3d3 archive.
Username Input AutoComplete
src/login/pages/Login.tsx, src/login/pages/LoginUsername.tsx
Conditioned username input autocomplete attribute to use "username webauthn" when enableWebAuthnConditionalUI is enabled, otherwise "username".
WebAuthn Conditional UI Integration
src/login/pages/Login.useScript.tsx, src/login/pages/LoginPassword.useScript.tsx, src/login/pages/LoginUsername.useScript.tsx, src/login/pages/LoginPasskeysConditionalAuthenticate.useScript.tsx
Added enableWebAuthnConditionalUI flag to KcContextLike; expanded I18nLike.msgStr to accept "passkey-unsupported-browser-text"; imported initAuthenticate from passkeysConditionalAuth.js; refactored input construction to serialize challenge/userVerification/rpId via JSON.stringify; updated click handlers to use arrow functions with one-time execution; modified useEffect gating to depend on feature flag enablement.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Whiskers twitch with passkey glee,
WebAuthn hops from page to key,
One-time listeners, JSON dreams,
Conditional UI's gleaming schemes,
Safer logins, clever and bright,
No passwords needed—hopping right! 🔐✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title '#900' is a generic reference number that does not describe any aspect of the actual changes in the changeset. Replace the title with a descriptive summary of the main changes, such as 'Add WebAuthn conditional UI support for passkey authentication' or 'Enable WebAuthn conditional authentication across login pages'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue_990

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
src/login/pages/Login.useScript.tsx (1)

67-79: enableWebAuthnConditionalUI is checked in the effect body but missing from the dependency array.

Since kcContext is server-provided and immutable during the component lifecycle, this won't cause a runtime bug. However, it's inconsistent with React's exhaustive-deps rule and could mislead future maintainers.

Proposed fix
-    }, [isFetchingTranslations]);
+    }, [isFetchingTranslations, kcContext.enableWebAuthnConditionalUI]);
src/login/pages/LoginUsername.useScript.tsx (1)

34-65: The script injection logic is nearly identical across Login.useScript.tsx, LoginUsername.useScript.tsx, and LoginPassword.useScript.tsx.

All three files share the same input construction, authenticateByWebAuthn click handler, initAuthenticate call, and useEffect gating logic — differing only in componentOrHookName and the KcContext type assertion. Consider extracting a shared helper to reduce the maintenance surface.


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 and usage tips.

@garronej garronej merged commit 77bf232 into main Feb 7, 2026
7 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