Merge branch 'main' into feature/update-branding

This commit is contained in:
Timur Ercan
2023-05-27 18:22:13 +02:00
committed by GitHub
5 changed files with 32 additions and 8 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 {