Chore/standardize password criteria (#4550)

standardize password criteria
This commit is contained in:
Henry Heng
2025-06-01 10:41:47 +01:00
committed by GitHub
parent a88337cc83
commit 63ff703e7a
8 changed files with 14 additions and 10 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ export const passwordSchema = z
.regex(/[a-z]/, 'Password must contain at least one lowercase letter')
.regex(/[A-Z]/, 'Password must contain at least one uppercase letter')
.regex(/\d/, 'Password must contain at least one digit')
.regex(/[@$!%*?&-]/, 'Password must contain at least one special character (@$!%*?&-)')
.regex(/[^a-zA-Z0-9]/, 'Password must contain at least one special character')
export const validatePassword = (password) => {
const result = passwordSchema.safeParse(password)