From 6be0510927f03e7c14c7bc42cc1f7110bb26c8d2 Mon Sep 17 00:00:00 2001 From: Michael Zetterberg Date: Wed, 16 Oct 2024 11:35:43 +0200 Subject: [PATCH] fix: new password can be optional when submitting edit profile --- components/Forms/Edit/Profile/schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Forms/Edit/Profile/schema.ts b/components/Forms/Edit/Profile/schema.ts index 681a67240..e785b4716 100644 --- a/components/Forms/Edit/Profile/schema.ts +++ b/components/Forms/Edit/Profile/schema.ts @@ -26,7 +26,7 @@ export const editProfileSchema = z ), password: z.string().optional(), - newPassword: z.literal("").or(passwordValidator()), + newPassword: z.literal("").optional().or(passwordValidator()), retypeNewPassword: z.string().optional(), }) .superRefine((data, ctx) => {