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:
1 parent
10e50eb8c7
commit
a0cb1b03be
4 files changed
+4
-4
No files matched your search
@@ -18,7 +18,7 @@ const schema = z.object({
|
||||
password: z
|
||||
.string()
|
||||
.min(8)
|
||||
.regex(/^(?=.*[A-Z])(?=.*[0-9]).+$/),
|
||||
.regex(/^(?=.*\p{Lu})(?=.*\d).+$/u),
|
||||
})
|
||||
|
||||
type FormValues = z.infer<typeof schema>
|
||||
|
||||
@@ -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