Skip to content

Conversation

@tomhung
Copy link

@tomhung tomhung commented Dec 4, 2025

Summary

Changes

  • AutofillSettingEntity - Entity with schema validation for the copyTotpOnAutofill boolean setting
  • AutofillSettingLocalStorage - Local storage service to persist user preference
  • GetAutofillSettingController / SetAutofillSettingController - Controllers to get/set the setting
  • AutofillSettingEvents - Event listeners for worker communication
  • Modified AutofillController to check the setting before copying TOTP
  • Registered events in appPagemod.js and quickAccessPagemod.js

Note to reviewers

This PR provides an alternative approach to PR #250. Passbolt can choose to:

  1. Accept only PR feat(autofill): copy TOTP to clipboard after credential autofill #250 (always copies TOTP - simpler)
  2. Accept this PR instead (user-controlled setting - more flexible)

The backend infrastructure is ready; UI integration in passbolt-styleguide would be needed to expose the toggle in settings.

Test plan

  • Verify TOTP is NOT copied when setting is OFF (default)
  • Enable the setting via browser console/storage and verify TOTP IS copied on autofill
  • Verify setting persists across browser sessions

🤖 Generated with Claude Code

gravistech412 and others added 2 commits December 4, 2025 00:53
When autofilling credentials for a resource that has TOTP configured,
automatically copy the current TOTP code to the clipboard. This allows
users to quickly paste the TOTP code after the password is filled,
streamlining the login process for 2FA-enabled accounts.

- Add TotpService to generate TOTP codes using jsSHA (RFC 6238)
- Modify AutofillController to copy TOTP after filling credentials
- TOTP is copied with 30-second auto-clear (using existing clipboard service)
- Silently handles errors to not disrupt autofill if TOTP copy fails
Add a user-configurable setting to enable/disable automatic TOTP
clipboard copy when autofilling credentials. Default is OFF (opt-in).

This builds on the TOTP copy feature and adds:
- AutofillSettingEntity with schema validation
- AutofillSettingLocalStorage for persisting user preference
- Get/Set controllers for the setting
- AutofillSettingEvents for worker communication
- Integration in appPagemod and quickAccessPagemod

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants