[PR #1314] [MERGED] feat: disable 2fa with backup codes #1551

Closed
opened 2026-02-26 19:33:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1314
Author: @ephraimduncan
Created: 8/28/2024
Status: Merged
Merged: 8/29/2024
Merged by: @Mythie

Base: mainHead: disable-2fa


📝 Commits (4)

  • 14b24b4 feat: accept backup code for disabling 2fa
  • 3c4313a feat: use backupcode in disabling 2fa
  • 8b8a999 fix: 2fa and backup input content
  • 6a615b4 fix: minor updates

📊 Changes

6 files changed (+122 additions, -58 deletions)

View changed files

📝 apps/web/src/components/forms/2fa/disable-authenticator-app-dialog.tsx (+82 -32)
📝 packages/lib/server-only/2fa/disable-2fa.ts (+14 -6)
📝 packages/lib/translations/de/web.po (+11 -9)
📝 packages/lib/translations/en/web.po (+11 -9)
📝 packages/trpc/server/two-factor-authentication-router/router.ts (+2 -1)
📝 packages/trpc/server/two-factor-authentication-router/schema.ts (+2 -1)

📄 Description

Description

Allow disabling two-factor authentication (2FA) by using either their authenticator app (TOTP) or a backup code.

Changes Made

  • Updated the disable 2fa dialog to support both TOTP and backup code input
  • Disable 2fa by TOTP and backup code

Testing Performed

  • Tested disabling 2FA using TOTP code from the authenticator app
  • Tested disabling 2FA using backup code
  • Verified toggle functionality between TOTP and backup code inputs
  • Checked error handling for invalid inputs in both methods
  • Tested translations in supported languages
  • Ran unit tests for updated components and functions

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Summary by CodeRabbit

  • New Features
    • Enhanced two-factor authentication (2FA) disabling process by allowing users to provide either a time-based one-time password (TOTP) or a backup code.
    • Added a toggle feature for selecting the method of disabling 2FA.
  • Bug Fixes
    • Improved form submission handling to accommodate new input fields for TOTP and backup codes.
  • Documentation
    • Updated localization strings to reflect changes in the 2FA dialog, ensuring clarity in user messages.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/1314 **Author:** [@ephraimduncan](https://github.com/ephraimduncan) **Created:** 8/28/2024 **Status:** ✅ Merged **Merged:** 8/29/2024 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `disable-2fa` --- ### 📝 Commits (4) - [`14b24b4`](https://github.com/documenso/documenso/commit/14b24b487a1ac5488916bd4527b88a73b974a43f) feat: accept backup code for disabling 2fa - [`3c4313a`](https://github.com/documenso/documenso/commit/3c4313a944f75098335fd727f8a64e7879d85bf4) feat: use backupcode in disabling 2fa - [`8b8a999`](https://github.com/documenso/documenso/commit/8b8a9991a7bb1488642262dd9d2a831da576ec12) fix: 2fa and backup input content - [`6a615b4`](https://github.com/documenso/documenso/commit/6a615b4a2b690fded8d1e9fe339c322d6274d637) fix: minor updates ### 📊 Changes **6 files changed** (+122 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/components/forms/2fa/disable-authenticator-app-dialog.tsx` (+82 -32) 📝 `packages/lib/server-only/2fa/disable-2fa.ts` (+14 -6) 📝 `packages/lib/translations/de/web.po` (+11 -9) 📝 `packages/lib/translations/en/web.po` (+11 -9) 📝 `packages/trpc/server/two-factor-authentication-router/router.ts` (+2 -1) 📝 `packages/trpc/server/two-factor-authentication-router/schema.ts` (+2 -1) </details> ### 📄 Description ## Description Allow disabling two-factor authentication (2FA) by using either their authenticator app (TOTP) or a backup code. ## Changes Made - Updated the disable 2fa dialog to support both TOTP and backup code input - Disable 2fa by TOTP and backup code ## Testing Performed - Tested disabling 2FA using TOTP code from the authenticator app - Tested disabling 2FA using backup code - Verified toggle functionality between TOTP and backup code inputs - Checked error handling for invalid inputs in both methods - Tested translations in supported languages - Ran unit tests for updated components and functions ## Checklist <!--- Please check the boxes that apply to this pull request. --> <!--- You can add or remove items as needed. --> - [x] I have tested these changes locally and they work as expected. - [ ] I have added/updated tests that prove the effectiveness of these changes. - [ ] I have updated the documentation to reflect these changes, if applicable. - [x] I have followed the project's coding style guidelines. - [ ] I have addressed the code review feedback from the previous submission, if applicable. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced two-factor authentication (2FA) disabling process by allowing users to provide either a time-based one-time password (TOTP) or a backup code. - Added a toggle feature for selecting the method of disabling 2FA. - **Bug Fixes** - Improved form submission handling to accommodate new input fields for TOTP and backup codes. - **Documentation** - Updated localization strings to reflect changes in the 2FA dialog, ensuring clarity in user messages. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:33:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1551
No description provided.