feat: redirect signed document to completed page

This commit is contained in:
Ephraim Atta-Duncan
2023-09-05 13:53:18 +00:00
parent de3ebe16ee
commit 551918ab9b

View File

@ -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}`;