From 5dee6450ec1287b8b80621e29f6675004f56af2e Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Sat, 25 May 2024 10:41:39 -0300 Subject: [PATCH] fix(update credentials): allow only valid data or empty string --- src/controllers/api/accounts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/api/accounts.ts b/src/controllers/api/accounts.ts index 55964a0..8844a69 100644 --- a/src/controllers/api/accounts.ts +++ b/src/controllers/api/accounts.ts @@ -225,10 +225,10 @@ const updateCredentialsSchema = z.object({ locked: z.boolean().optional(), bot: z.boolean().optional(), discoverable: z.boolean().optional(), - nip05: z.string().email().optional(), + nip05: z.union([z.string().email().optional(), z.literal('')]), pleroma_settings_store: z.unknown().optional(), - lud16: z.string().email().optional(), - website: z.string().url().optional(), + lud16: z.union([z.string().email().optional(), z.literal('')]), + website: z.union([z.string().url().optional(), z.literal('')]), }); const updateCredentialsController: AppController = async (c) => {