[PR #1111] [MERGED] fix: prevent signing draft documents #1395

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

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/1111
Author: @dguyen
Created: 4/19/2024
Status: Merged
Merged: 4/19/2024
Merged by: @dguyen

Base: mainHead: fix/prevent-draft-signing


📝 Commits (4)

📊 Changes

11 files changed (+77 additions, -41 deletions)

View changed files

📝 apps/web/src/app/(dashboard)/documents/[id]/document-page-view.tsx (+5 -1)
📝 apps/web/src/app/(dashboard)/documents/[id]/edit/document-edit-page-view.tsx (+5 -1)
📝 apps/web/src/app/(dashboard)/documents/data-table-action-dropdown.tsx (+1 -1)
📝 apps/web/src/app/(dashboard)/documents/data-table.tsx (+6 -1)
📝 apps/web/src/app/(signing)/sign/[token]/page.tsx (+6 -1)
📝 apps/web/src/components/(dashboard)/avatar/avatar-with-recipient.tsx (+19 -16)
📝 apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx (+18 -4)
📝 packages/lib/server-only/document/complete-document-with-token.ts (+2 -2)
📝 packages/lib/server-only/field/remove-signed-field-with-token.ts (+2 -2)
📝 packages/lib/server-only/field/sign-field-with-token.ts (+4 -4)
📝 packages/prisma/seed/documents.ts (+9 -8)

📄 Description

Description

Currently users can sign and complete draft documents, which will result in a completed document in an invalid state.

Changes Made

  • Prevent recipients from inserting or uninserting fields for draft documents
  • Prevent recipients from completing draft documents
  • Remove ability to copy signing tokens unless document is pending

Summary by CodeRabbit

  • New Features

    • Enhanced document status visibility and control across various components in the application. Users can now see and interact with document statuses more dynamically in views like DocumentPageView, DocumentEditPageView, and DocumentsDataTable.
    • Improved document signing process with updated status checks, ensuring actions like signing, completing, and removing fields are only available under appropriate document statuses.
  • Bug Fixes

    • Adjusted document status validation logic in server-side operations to prevent actions on incorrectly stated documents, enhancing the overall security and functionality of document processing.

🔄 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/1111 **Author:** [@dguyen](https://github.com/dguyen) **Created:** 4/19/2024 **Status:** ✅ Merged **Merged:** 4/19/2024 **Merged by:** [@dguyen](https://github.com/dguyen) **Base:** `main` ← **Head:** `fix/prevent-draft-signing` --- ### 📝 Commits (4) - [`5ec5c42`](https://github.com/documenso/documenso/commit/5ec5c420663ddeb3f5fd16baee7840bdf7baaaa6) fix: prevent signing draft documents - [`522d3b1`](https://github.com/documenso/documenso/commit/522d3b19814ca85f0c2dab20031f4968ebac25b1) fix: stuff - [`242f194`](https://github.com/documenso/documenso/commit/242f1941ed9c36eb89bf56d14396bf8fa50fb15e) fix: tests - [`e4ab1b5`](https://github.com/documenso/documenso/commit/e4ab1b5f4de39157f85840589145f64b23af661f) fix: remove redundant draft actions ### 📊 Changes **11 files changed** (+77 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/src/app/(dashboard)/documents/[id]/document-page-view.tsx` (+5 -1) 📝 `apps/web/src/app/(dashboard)/documents/[id]/edit/document-edit-page-view.tsx` (+5 -1) 📝 `apps/web/src/app/(dashboard)/documents/data-table-action-dropdown.tsx` (+1 -1) 📝 `apps/web/src/app/(dashboard)/documents/data-table.tsx` (+6 -1) 📝 `apps/web/src/app/(signing)/sign/[token]/page.tsx` (+6 -1) 📝 `apps/web/src/components/(dashboard)/avatar/avatar-with-recipient.tsx` (+19 -16) 📝 `apps/web/src/components/(dashboard)/avatar/stack-avatars-with-tooltip.tsx` (+18 -4) 📝 `packages/lib/server-only/document/complete-document-with-token.ts` (+2 -2) 📝 `packages/lib/server-only/field/remove-signed-field-with-token.ts` (+2 -2) 📝 `packages/lib/server-only/field/sign-field-with-token.ts` (+4 -4) 📝 `packages/prisma/seed/documents.ts` (+9 -8) </details> ### 📄 Description ## Description Currently users can sign and complete draft documents, which will result in a completed document in an invalid state. ## Changes Made - Prevent recipients from inserting or uninserting fields for draft documents - Prevent recipients from completing draft documents - Remove ability to copy signing tokens unless document is pending <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced document status visibility and control across various components in the application. Users can now see and interact with document statuses more dynamically in views like `DocumentPageView`, `DocumentEditPageView`, and `DocumentsDataTable`. - Improved document signing process with updated status checks, ensuring actions like signing, completing, and removing fields are only available under appropriate document statuses. - **Bug Fixes** - Adjusted document status validation logic in server-side operations to prevent actions on incorrectly stated documents, enhancing the overall security and functionality of document processing. <!-- 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:04 +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#1395
No description provided.