chore: Add autocomplete attribute to 2FA input fields#37014
chore: Add autocomplete attribute to 2FA input fields#37014dionisio-bot[bot] merged 7 commits intoRocketChat:developfrom
autocomplete attribute to 2FA input fields#37014Conversation
|
|
Looks like this PR is ready to merge! 🎉 |
WalkthroughAdded autoComplete="one-time-code" to the TOTP authentication code TextInput in the 2FA security screen to support browser autofill for one-time codes. No other changes or API modifications. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
apps/meteor/client/views/account/security/TwoFactorTOTP.tsx (3)
161-161: Good fix: adds OTP autofill support.KeePassXC and modern browsers key off
autocomplete="one-time-code". Change looks correct.Consider mobile UX and avoiding mis-parsing leading zeros. Add numeric hints without switching to
type="number":-<TextInput id={totpCodeId} mie='8px' {...register('authCode')} autoComplete="one-time-code"/> +<TextInput + id={totpCodeId} + mie='8px' + {...register('authCode')} + autoComplete='one-time-code' + inputMode='numeric' + pattern='[0-9]*' + autoCapitalize='off' + autoCorrect='off' + spellCheck={false} +/>
161-161: Minor: quote style consistency.Elsewhere props use single quotes; switch
"one-time-code"to'one-time-code'for consistency.
161-161: Add autoComplete='one-time-code' to OTP inputsApply autoComplete="one-time-code" to the TextInput fields so platform OTP autofill works consistently:
- apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx — add autoComplete="one-time-code" to the TextInput.
- apps/meteor/client/components/TwoFactorModal/TwoFactorEmailModal.tsx — add autoComplete="one-time-code" to the TextInput.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/meteor/client/views/account/security/TwoFactorTOTP.tsx(1 hunks)
|
@dougfabris do u know if this is still valid? |
autocomplete attribute to 2FA input fields
|
/jira COMM |
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/meteor/client/views/account/security/TwoFactorTOTP.tsx">
<violation number="1">
P3: The TOTP input lost `autoComplete="one-time-code"`, which can disable OTP autofill/password-manager detection for this flow. Re-add the attribute to preserve expected 2FA autofill behavior.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37014 +/- ##
===========================================
- Coverage 70.26% 70.21% -0.06%
===========================================
Files 3279 3280 +1
Lines 116798 116814 +16
Branches 20742 20667 -75
===========================================
- Hits 82066 82017 -49
- Misses 31457 31510 +53
- Partials 3275 3287 +12
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
Adds
autocomplete="one-time-code"attribute to the 2FA TOTP and Email code input fields to improve password manager compatibility (KeePassXC, Bitwarden, 1Password, etc.).Changes
TwoFactorTotpModal.tsx- AddedautoComplete='one-time-code'to TextInputTwoFactorEmailModal.tsx- AddedautoComplete='one-time-code'to TextInputThis follows the W3C recommendation for one-time code fields.
Issue(s)
Fixes #30025
Steps to test or reproduce
Further comments
This is a minimal, focused fix addressing the accessibility issue. The
autocomplete="one-time-code"attribute is the standard way to identify OTP fields per HTML specification.Summary by CodeRabbit
Task: COMM-148