Skip to content

fix: add autocomplete attribute to 2FA input fields#38411

Closed
Avanish-Gupta-CSE wants to merge 2 commits intoRocketChat:developfrom
Avanish-Gupta-CSE:fix/issue-30025-2fa-autocomplete
Closed

fix: add autocomplete attribute to 2FA input fields#38411
Avanish-Gupta-CSE wants to merge 2 commits intoRocketChat:developfrom
Avanish-Gupta-CSE:fix/issue-30025-2fa-autocomplete

Conversation

@Avanish-Gupta-CSE
Copy link
Copy Markdown

@Avanish-Gupta-CSE Avanish-Gupta-CSE commented Jan 29, 2026

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 - Added autoComplete='one-time-code' to TextInput
  • TwoFactorEmailModal.tsx - Added autoComplete='one-time-code' to TextInput

This follows the W3C recommendation for one-time code fields.

Issue(s)

Fixes #30025

Steps to test or reproduce

  1. Enable 2FA on your account
  2. Log out and log back in
  3. When prompted for 2FA code, verify that password managers (KeePassXC, Bitwarden, etc.) now recognize the field and offer to autofill

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

  • Bug Fixes
    • Improved autofill support for two-factor authentication one-time codes in both email and authenticator app verification methods.

✏️ Tip: You can customize this high-level summary in your review settings.

@Avanish-Gupta-CSE Avanish-Gupta-CSE requested a review from a team as a code owner January 29, 2026 09:50
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Jan 29, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: a46b472

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 29, 2026

Walkthrough

Added the HTML attribute autoComplete='one-time-code' to the 2FA input fields in the email and TOTP modals and included a changeset documenting the fix. No other behavior, exports, or logic were modified.

Changes

Cohort / File(s) Summary
Two-Factor Modal Components
apps/meteor/client/components/TwoFactorModal/TwoFactorEmailModal.tsx, apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx
Added autoComplete='one-time-code' to the TextInput elements in the email and TOTP 2FA modals to help browsers/password managers recognize one-time code fields.
Changeset
.changeset/fix-2fa-autocomplete.md
New changeset added documenting the patch and describing the addition of the autocomplete attribute for 2FA inputs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • KevLehman
  • tassoevan
  • abhinavkrin

Poem

🐰 I nibbled the code, left a tiny trace,

autoComplete set — now managers embrace.
One-time codes hop into fields with glee,
A small carrot fix from your friend, the rabbit, and me.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding the autocomplete attribute to 2FA input fields to improve password manager compatibility.
Linked Issues check ✅ Passed The PR directly addresses issue #30025 by adding autocomplete='one-time-code' to both TOTP and email 2FA input fields, matching the recommended solution from KeePassXC developers.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue objective: adding the autocomplete attribute to 2FA inputs. No unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • ISSUE-30025: Request failed with status code 404

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.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Adds autocomplete="one-time-code" to TOTP and Email 2FA input fields
for better password manager compatibility (KeePassXC, Bitwarden, etc.)

Fixes RocketChat#30025
@Avanish-Gupta-CSE Avanish-Gupta-CSE force-pushed the fix/issue-30025-2fa-autocomplete branch from a6cd720 to 8d03b0e Compare January 29, 2026 09:58
@Avanish-Gupta-CSE
Copy link
Copy Markdown
Author

Hi team, just checking in on this PR. The CI checks are all passing. Is there anything I can do to help move this forward? Happy to make any adjustments if needed. Thank you!

@dougfabris
Copy link
Copy Markdown
Member

Hi there, thanks for the contribution! 🚀 💯

Closing this PR because it's duplicated now and it has been fixed here: #37014


Questions? Help needed? Feature Requests?

  • Join our Open Server in the #support channel and feel free to raise a question
  • Join our Community Forum and search/create a post there

@dougfabris dougfabris closed this Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

provide better identification for 2FA TOTP field / dialog after login to ensure password managers are functional

2 participants