From a93085ae1d5cc0df3da077899d9f7b06baaa4a4d Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Wed, 26 Jun 2024 15:39:48 -1000 Subject: [PATCH] fix(api): :bug: Allow empty website in app creation to fix issue with Traewelling --- server/api/api/v1/apps/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/api/api/v1/apps/index.ts b/server/api/api/v1/apps/index.ts index 0d791347..3d317a39 100644 --- a/server/api/api/v1/apps/index.ts +++ b/server/api/api/v1/apps/index.ts @@ -32,7 +32,15 @@ export const schemas = { .url() .or(z.literal("urn:ietf:wg:oauth:2.0:oob")), scopes: z.string().min(1).max(200), - website: z.string().min(0).max(2000).url().optional(), + website: z + .string() + .min(0) + .max(2000) + .url() + .optional() + // Allow empty websites because Traewelling decides to give an empty + // value instead of not providing anything at all + .or(z.literal("").transform(() => undefined)), }), };