From 551918ab9b6fa6037a3585c5d85d5e8b98fcbfd7 Mon Sep 17 00:00:00 2001 From: Ephraim Atta-Duncan Date: Tue, 5 Sep 2023 13:53:18 +0000 Subject: [PATCH] feat: redirect signed document to completed page --- apps/web/src/app/(signing)/sign/[token]/page.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/app/(signing)/sign/[token]/page.tsx b/apps/web/src/app/(signing)/sign/[token]/page.tsx index 35621068a..a55687196 100644 --- a/apps/web/src/app/(signing)/sign/[token]/page.tsx +++ b/apps/web/src/app/(signing)/sign/[token]/page.tsx @@ -1,4 +1,4 @@ -import { notFound } from 'next/navigation'; +import { notFound, redirect } from 'next/navigation'; import { match } from 'ts-pattern'; @@ -44,6 +44,10 @@ export default async function SigningPage({ params: { token } }: SigningPageProp return notFound(); } + if (document?.status === 'COMPLETED') { + redirect(`/sign/${token}/complete`); + } + const user = await getServerComponentSession(); const documentUrl = `data:application/pdf;base64,${document.document}`;