feat: support leading cert from custom path

This commit is contained in:
Mythie
2023-05-27 01:07:07 +10:00
parent ae0799168a
commit 32f904ad68
4 changed files with 28 additions and 9 deletions

View File

@ -59,7 +59,7 @@ export async function getServerSideProps(context: any) {
},
});
const recipient = await prisma.recipient.findFirstOrThrow({
const recipient = await prisma.recipient.findFirst({
where: {
token: recipientToken,
},
@ -68,6 +68,15 @@ export async function getServerSideProps(context: any) {
},
});
if (!recipient) {
return {
redirect: {
permanent: false,
destination: "/404",
},
};
}
// Document is already signed
if (recipient.Document.status === DocumentStatus.COMPLETED) {
return {