chore: finish and clean-up redirect post signing

Signed-off-by: Adithya Krishna <adi@documenso.com>
This commit is contained in:
Adithya Krishna
2024-02-06 18:04:56 +05:30
parent 9ed16c64d8
commit 2636d5fd16
13 changed files with 128 additions and 92 deletions

View File

@ -1,5 +1,6 @@
import { z } from 'zod';
import { URL_REGEX } from '@documenso/lib/constants/url-regex';
import { DocumentStatus, FieldType, RecipientRole } from '@documenso/prisma/client';
export const ZGetDocumentByIdQuerySchema = z.object({
@ -71,7 +72,12 @@ export const ZSendDocumentMutationSchema = z.object({
message: z.string(),
timezone: z.string(),
dateFormat: z.string(),
redirectUrl: z.string().optional(),
redirectUrl: z
.string()
.optional()
.refine((value) => value === undefined || URL_REGEX.test(value), {
message: 'Please enter a valid URL',
}),
}),
});