Skip to content

The Open Source DocuSign Alternative.

add token to download link to allow download without user

Timur Ercan91b206e3d7a1
diff --git a/apps/web/pages/documents/[id]/signed.tsx b/apps/web/pages/documents/[id]/signed.tsx
index 31b7bd118..8075fe226 100644
--- a/apps/web/pages/documents/[id]/signed.tsx
+++ b/apps/web/pages/documents/[id]/signed.tsx
@@ -6,7 +6,7 @@ import { Button, IconButton } from "@documenso/ui";
import Link from "next/link";
import { useRouter } from "next/router";
-const SignPage: NextPageWithLayout = (props: any) => {
+const Signed: NextPageWithLayout = (props: any) => {
const router = useRouter();
const allRecipientsSigned = props.document.Recipient?.every(
(r: any) => r.signingStatus === "SIGNED"
@@ -47,7 +47,12 @@ const SignPage: NextPageWithLayout = (props: any) => {
onClick={(event: any) => {
event.preventDefault();
event.stopPropagation();
- router.push("/api/documents/" + props.document.id);
+ router.push(
+ "/api/documents/" +
+ props.document.id +
+ "?token=" +
+ props.recipient.token
+ );
}}
>
Download "{props.document.title}"
@@ -103,8 +108,9 @@ export async function getServerSideProps(context: any) {
props: {
document: JSON.parse(JSON.stringify(recipient.Document)),
fields: JSON.parse(JSON.stringify(fields)),
+ recipient: JSON.parse(JSON.stringify(recipient)),
},
};
}
-export default SignPage;
+export default Signed;