[PR #1065] [MERGED] feat: add passkey and 2FA document action auth options #1356

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

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1065
Author: @dguyen
Created: 3/28/2024
Status: Merged
Merged: 3/31/2024
Merged by: @dguyen

Base: mainHead: feat/add-document-2fa-passkey


📝 Commits (4)

📊 Changes

27 files changed (+966 additions, -243 deletions)

View changed files

📝 apps/web/src/app/(dashboard)/settings/security/passkeys/create-passkey-dialog.tsx (+3 -1)
apps/web/src/app/(signing)/sign/[token]/document-action-auth-2fa.tsx (+172 -0)
apps/web/src/app/(signing)/sign/[token]/document-action-auth-account.tsx (+79 -0)
📝 apps/web/src/app/(signing)/sign/[token]/document-action-auth-dialog.tsx (+28 -179)
apps/web/src/app/(signing)/sign/[token]/document-action-auth-passkey.tsx (+252 -0)
📝 apps/web/src/app/(signing)/sign/[token]/document-auth-provider.tsx (+68 -6)
📝 apps/web/src/app/(signing)/sign/[token]/form.tsx (+4 -4)
📝 apps/web/src/components/forms/2fa/enable-authenticator-app-dialog.tsx (+8 -2)
📝 apps/web/src/components/forms/signin.tsx (+1 -1)
📝 packages/app-tests/e2e/document-auth/action-auth.spec.ts (+3 -3)
📝 packages/app-tests/e2e/pr-718-add-stepper-component.spec.ts (+17 -5)
📝 packages/lib/constants/document-auth.ts (+8 -13)
📝 packages/lib/next-auth/auth-options.ts (+2 -2)
packages/lib/server-only/auth/create-passkey-authentication-options.ts (+76 -0)
📝 packages/lib/server-only/auth/create-passkey-registration-options.ts (+2 -2)
📝 packages/lib/server-only/auth/create-passkey-signin-options.ts (+2 -2)
📝 packages/lib/server-only/auth/create-passkey.ts (+2 -2)
📝 packages/lib/server-only/auth/find-passkeys.ts (+7 -2)
📝 packages/lib/server-only/document/is-recipient-authorized.ts (+134 -7)
📝 packages/lib/types/document-auth.ts (+36 -4)

...and 7 more files

📄 Description

Description

Add the following document action auth options:

  • 2FA
  • Passkey

If the user does not have the required auth setup, we onboard them directly.

Changes made

Note: Added secondaryId to the VerificationToken schema

Testing Performed

Tested locally, pending preview tests

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 followed the project's coding style guidelines.

Summary by CodeRabbit

  • New Features
    • Introduced components for 2FA, account, and passkey authentication during document signing.
    • Added "Require passkey" option to document settings and signer authentication settings.
    • Enhanced form submission and loading states for improved user experience.
  • Refactor
    • Optimized authentication components to efficiently support multiple authentication methods.
  • Chores
    • Updated and renamed functions and components for clarity and consistency across the authentication system.
    • Refined sorting options and database schema to support new authentication features.
  • Bug Fixes
    • Adjusted SignInForm to verify browser support for WebAuthn before proceeding.

🔄 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/1065 **Author:** [@dguyen](https://github.com/dguyen) **Created:** 3/28/2024 **Status:** ✅ Merged **Merged:** 3/31/2024 **Merged by:** [@dguyen](https://github.com/dguyen) **Base:** `main` ← **Head:** `feat/add-document-2fa-passkey` --- ### 📝 Commits (4) - [`6e78d1a`](https://github.com/documenso/documenso/commit/6e78d1ae458ad9a9cb02e72afcfc7e37028de157) feat: add document auth passkey and 2FA - [`671ce93`](https://github.com/documenso/documenso/commit/671ce931df360a27cdfc088f06b4a6b33997e60a) fix: migration - [`4092539`](https://github.com/documenso/documenso/commit/4092539efa29580dc6f79c38cf7960af4d26be3e) fix: tests - [`d37f549`](https://github.com/documenso/documenso/commit/d37f549a09ab749f208f91ba593032b5e705b87f) fix: tests ### 📊 Changes **27 files changed** (+966 additions, -243 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/app/(dashboard)/settings/security/passkeys/create-passkey-dialog.tsx` (+3 -1) ➕ `apps/web/src/app/(signing)/sign/[token]/document-action-auth-2fa.tsx` (+172 -0) ➕ `apps/web/src/app/(signing)/sign/[token]/document-action-auth-account.tsx` (+79 -0) 📝 `apps/web/src/app/(signing)/sign/[token]/document-action-auth-dialog.tsx` (+28 -179) ➕ `apps/web/src/app/(signing)/sign/[token]/document-action-auth-passkey.tsx` (+252 -0) 📝 `apps/web/src/app/(signing)/sign/[token]/document-auth-provider.tsx` (+68 -6) 📝 `apps/web/src/app/(signing)/sign/[token]/form.tsx` (+4 -4) 📝 `apps/web/src/components/forms/2fa/enable-authenticator-app-dialog.tsx` (+8 -2) 📝 `apps/web/src/components/forms/signin.tsx` (+1 -1) 📝 `packages/app-tests/e2e/document-auth/action-auth.spec.ts` (+3 -3) 📝 `packages/app-tests/e2e/pr-718-add-stepper-component.spec.ts` (+17 -5) 📝 `packages/lib/constants/document-auth.ts` (+8 -13) 📝 `packages/lib/next-auth/auth-options.ts` (+2 -2) ➕ `packages/lib/server-only/auth/create-passkey-authentication-options.ts` (+76 -0) 📝 `packages/lib/server-only/auth/create-passkey-registration-options.ts` (+2 -2) 📝 `packages/lib/server-only/auth/create-passkey-signin-options.ts` (+2 -2) 📝 `packages/lib/server-only/auth/create-passkey.ts` (+2 -2) 📝 `packages/lib/server-only/auth/find-passkeys.ts` (+7 -2) 📝 `packages/lib/server-only/document/is-recipient-authorized.ts` (+134 -7) 📝 `packages/lib/types/document-auth.ts` (+36 -4) _...and 7 more files_ </details> ### 📄 Description ## Description Add the following document action auth options: - 2FA - Passkey If the user does not have the required auth setup, we onboard them directly. ## Changes made Note: Added secondaryId to the VerificationToken schema ## Testing Performed Tested locally, pending preview tests ## Checklist - [X] I have tested these changes locally and they work as expected. - [X] I have added/updated tests that prove the effectiveness of these changes. - [X] I have followed the project's coding style guidelines. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced components for 2FA, account, and passkey authentication during document signing. - Added "Require passkey" option to document settings and signer authentication settings. - Enhanced form submission and loading states for improved user experience. - **Refactor** - Optimized authentication components to efficiently support multiple authentication methods. - **Chores** - Updated and renamed functions and components for clarity and consistency across the authentication system. - Refined sorting options and database schema to support new authentication features. - **Bug Fixes** - Adjusted SignInForm to verify browser support for WebAuthn before proceeding. <!-- 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:32:54 +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#1356
No description provided.