[PR #2279] [MERGED] fix: embed authoring permission issue #2178

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

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2279
Author: @tedliang
Created: 12/4/2025
Status: Merged
Merged: 12/4/2025
Merged by: @Mythie

Base: mainHead: fix/embed-authoring-permission-issue


📝 Commits (1)

  • 3f78059 fix: embed authoring permission issue

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/lib/utils/envelope-download.ts (+1 -1)

📄 Description

Description

Permission issue in embed authoring.
In configure fields step, got the following error: Something went wrong while loading the document.
image

Here is the analysis:
In configure-fields-view.tsx line 549, presignToken is passed to PDFViewer component:

<PDFViewerLazy
  presignToken={presignToken}
  overrideData={normalizedDocumentData}
  envelopeItem={normalizedEnvelopeItem}
  token={undefined}
  version="signed"
/>

In PDFViewer (packages/ui/primitives/pdf-viewer/base.tsx line 180)

const documentUrl = getEnvelopeItemPdfUrl({
  type: 'view',
  envelopeItem: envelopeItem,
  token,
  presignToken,
});

In envelope-download.ts line 35, we should pass the presignToke to the backend to load the envelopeItem when the token is undefined:

  return token
    ? `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/token/${token}/envelopeItem/${id}${presignToken ? `?presignToken=${presignToken}` : ''}`
    : `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/envelope/${envelopeId}/envelopeItem/${id}`;

N/A

Changes Made

Pass the missing token to the get envelopeItem endpoint.

Testing Performed

Tested in Chrome.

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.

Additional Notes

N/A


🔄 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/2279 **Author:** [@tedliang](https://github.com/tedliang) **Created:** 12/4/2025 **Status:** ✅ Merged **Merged:** 12/4/2025 **Merged by:** [@Mythie](https://github.com/Mythie) **Base:** `main` ← **Head:** `fix/embed-authoring-permission-issue` --- ### 📝 Commits (1) - [`3f78059`](https://github.com/documenso/documenso/commit/3f78059a296672ee8d99db6b66fec581940ba998) fix: embed authoring permission issue ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/lib/utils/envelope-download.ts` (+1 -1) </details> ### 📄 Description ## Description Permission issue in embed authoring. In configure fields step, got the following error: Something went wrong while loading the document. <img width="524" height="156" alt="image" src="https://github.com/user-attachments/assets/aef438df-67d2-4092-86d0-4000467c46ca" /> Here is the analysis: In configure-fields-view.tsx line 549, presignToken is passed to PDFViewer component: ``` <PDFViewerLazy presignToken={presignToken} overrideData={normalizedDocumentData} envelopeItem={normalizedEnvelopeItem} token={undefined} version="signed" /> ``` In PDFViewer (packages/ui/primitives/pdf-viewer/base.tsx line 180) ``` const documentUrl = getEnvelopeItemPdfUrl({ type: 'view', envelopeItem: envelopeItem, token, presignToken, }); ``` In envelope-download.ts line 35, we should pass the presignToke to the backend to load the envelopeItem when the token is undefined: ``` return token ? `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/token/${token}/envelopeItem/${id}${presignToken ? `?presignToken=${presignToken}` : ''}` : `${NEXT_PUBLIC_WEBAPP_URL()}/api/files/envelope/${envelopeId}/envelopeItem/${id}`; ``` ## Related Issue N/A ## Changes Made Pass the missing token to the get envelopeItem endpoint. ## Testing Performed Tested in Chrome. ## 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. - [X] I have added/updated tests that prove the effectiveness of these changes. - [X] I have updated the documentation to reflect these changes, if applicable. - [X] I have followed the project's coding style guidelines. - [X] I have addressed the code review feedback from the previous submission, if applicable. ## Additional Notes N/A --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 20:32:46 +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#2178
No description provided.