From a14aeffa483a42c68a9d4cb1c14412111144cfc0 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 11 Aug 2024 21:36:53 +0200 Subject: [PATCH] bugfixing password --- src/lib/schemas.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/schemas.js b/src/lib/schemas.js index 4be8ca1e..a60b3f45 100644 --- a/src/lib/schemas.js +++ b/src/lib/schemas.js @@ -20,13 +20,13 @@ export const registerUserSchema = z .email({ message: 'Email must be a valid email' }), password: z .string({ required_error: 'Password is required' }) - .regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^]{8,}$/, { + .regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/, { message: 'Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.' }), passwordConfirm: z .string({ required_error: 'Confirm Password is required' }) - .regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^]{8,}$/, { + .regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/, { message: 'Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.' }) @@ -189,13 +189,13 @@ export const updatePasswordSchema = z oldPassword: z.string({ required_error: 'Old password is required' }), password: z .string({ required_error: 'Password is required' }) - .regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^]{8,}$/, { + .regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/, { message: 'Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.' }), passwordConfirm: z .string({ required_error: 'Confirm Password is required' }) - .regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^]{8,}$/, { + .regex(/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&+\-,.\[\]{};':"\\|/=\(\)\^_*]{8,}$/, { message: 'Password must be a minimum of 8 characters & contain at least one letter, one number, and one special character.' })