Refactor password validation regex for consistency across application
- Updated password validation regex in ChangePasswordCommandValidator, RegisterCommandValidator, RegisterForm, and ChangePasswordForm to use Unicode property escapes for uppercase letters, ensuring consistent validation rules across both backend and frontend components.
This commit is contained in:
@@ -15,7 +15,7 @@ const schema = z.object({
|
||||
newPassword: z
|
||||
.string()
|
||||
.min(8)
|
||||
.regex(/^(?=.*[A-Z])(?=.*[0-9]).+$/),
|
||||
.regex(/^(?=.*\p{Lu})(?=.*\d).+$/u),
|
||||
})
|
||||
|
||||
type FormValues = z.infer<typeof schema>
|
||||
|
||||
Reference in New Issue
Block a user