Redirect After Document Decline
Feature Description
Currently, when a document has a RedirectUrl configured, the signer is automatically redirected to that URL after signing the document (with a 5-second countdown timer and cancel option). However, if the signer declines the document, no redirect occurs — the user simply sees a "You have declined this document" message and stays on the signing page.
This feature request is to extend the same redirect behavior to the decline flow, so that signers are also redirected to the configured RedirectUrl after declining a document.
Current Behavior
Signer opens document via signing link.
Signer clicks Decline and confirms with an optional reason.
A modal shows "You have declined this document."
Signer stays on the page indefinitely. No redirect happens even if RedirectUrl is set on the document.
Expected Behavior
Signer opens document via signing link.
Signer clicks Decline and confirms with an optional reason.
A modal shows "You have declined this document."
If RedirectUrl is configured, a 5-second countdown redirect notice appears (identical to the post-sign redirect), with the option to cancel.
After the countdown, the signer is redirected to the RedirectUrl.
Affected Files
apps/OpenSign/src/pages/PdfRequestFiles.jsx
declineDoc() function — trigger redirect timer after successful decline API call
PdfDeclineModal rendering — show RedirectNotice component in the "YouDeclined" state
Implementation Details
The existing redirect infrastructure (redirectUrl, redirectTimeLeft, isredirectCanceled, RedirectNotice component, openInNewTab) can be fully reused. The changes are minimal:
In declineDoc() success handler (~line 1176-1179): After the decline API succeeds and isDecline is set to YouDeclined, also call setIsredirectCanceled(false) if redirectUrl exists — this starts the countdown timer.
In the PdfDeclineModal body (~line 1876-1880): For the YouDeclined state, append the component alongside the t("decline-alert-2") text.
Why This Matters
Consistency: Signing and declining are both terminal actions on a document. Both should respect the document's redirect configuration.
Integration Use Cases: External systems that embed OpenSign for signing workflows often use RedirectUrl to return users to their own application. If a user declines, the external system has no way to bring the user back without this feature.
User Experience: Without the redirect, a guest signer who declines is left on a dead-end page with no clear next step.
Additional Context
The redirect uses a 5-second countdown timer with a Cancel button, so users are not forced to redirect immediately.
The redirect is triggered via openInNewTab(redirectUrl, "_self") which navigates in the same tab.
Guest signers (via /load/recipientSignPdf/...) and logged-in signers (via /recipientSignPdf/...) would both benefit from this change.
What type of feature are you requesting?
UI/UX Improvement
Importance
Medium
Additional Context
No response
Code of Conduct
Redirect After Document Decline
Feature Description
Currently, when a document has a RedirectUrl configured, the signer is automatically redirected to that URL after signing the document (with a 5-second countdown timer and cancel option). However, if the signer declines the document, no redirect occurs — the user simply sees a "You have declined this document" message and stays on the signing page.
This feature request is to extend the same redirect behavior to the decline flow, so that signers are also redirected to the configured RedirectUrl after declining a document.
Current Behavior
Signer opens document via signing link.
Signer clicks Decline and confirms with an optional reason.
A modal shows "You have declined this document."
Signer stays on the page indefinitely. No redirect happens even if RedirectUrl is set on the document.
Expected Behavior
Signer opens document via signing link.
Signer clicks Decline and confirms with an optional reason.
A modal shows "You have declined this document."
If RedirectUrl is configured, a 5-second countdown redirect notice appears (identical to the post-sign redirect), with the option to cancel.
After the countdown, the signer is redirected to the RedirectUrl.
Affected Files
apps/OpenSign/src/pages/PdfRequestFiles.jsx
declineDoc() function — trigger redirect timer after successful decline API call
PdfDeclineModal rendering — show RedirectNotice component in the "YouDeclined" state
Implementation Details
The existing redirect infrastructure (redirectUrl, redirectTimeLeft, isredirectCanceled, RedirectNotice component, openInNewTab) can be fully reused. The changes are minimal:
In declineDoc() success handler (~line 1176-1179): After the decline API succeeds and isDecline is set to YouDeclined, also call setIsredirectCanceled(false) if redirectUrl exists — this starts the countdown timer.
In the PdfDeclineModal body (~line 1876-1880): For the YouDeclined state, append the component alongside the t("decline-alert-2") text.
Why This Matters
Consistency: Signing and declining are both terminal actions on a document. Both should respect the document's redirect configuration.
Integration Use Cases: External systems that embed OpenSign for signing workflows often use RedirectUrl to return users to their own application. If a user declines, the external system has no way to bring the user back without this feature.
User Experience: Without the redirect, a guest signer who declines is left on a dead-end page with no clear next step.
Additional Context
The redirect uses a 5-second countdown timer with a Cancel button, so users are not forced to redirect immediately.
The redirect is triggered via openInNewTab(redirectUrl, "_self") which navigates in the same tab.
Guest signers (via /load/recipientSignPdf/...) and logged-in signers (via /recipientSignPdf/...) would both benefit from this change.
What type of feature are you requesting?
UI/UX Improvement
Importance
Medium
Additional Context
No response
Code of Conduct