From f46c2edd1b8c9e1d4841c0cc812b74741f6015dc Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Fri, 15 May 2026 10:58:38 -0700 Subject: [PATCH] add password and newPassword to editUserValidation --- server/src/validation/userValidation.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/src/validation/userValidation.ts b/server/src/validation/userValidation.ts index e613b86e6..c26c10116 100644 --- a/server/src/validation/userValidation.ts +++ b/server/src/validation/userValidation.ts @@ -49,6 +49,16 @@ export const editUserBodyValidation = z.object({ lastName: nameValidation.optional(), email: lowercaseEmailValidation.optional(), profilePicture: z.string().optional(), + password: z + .string() + .min(8, "Password must be at least 8 characters") + .regex(passwordPattern, "Password must contain at least one lowercase letter, one uppercase letter, one number, and one special character") + .optional(), + newPassword: z + .string() + .min(8, "Password must be at least 8 characters") + .regex(passwordPattern, "Password must contain at least one lowercase letter, one uppercase letter, one number, and one special character") + .optional(), }); // Canonical user shape returned by auth/user endpoints. Keep aligned with what