mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 22:25:42 +00:00
fixes
This commit is contained in:
@@ -6,7 +6,10 @@ export const passwordRequirements = [
|
||||
{ label: "One uppercase letter", test: (v: string) => /[A-Z]/.test(v) },
|
||||
{ label: "One lowercase letter", test: (v: string) => /[a-z]/.test(v) },
|
||||
{ label: "One number", test: (v: string) => /\d/.test(v) },
|
||||
{ label: "One special character", test: (v: string) => /[^A-Za-z0-9]/.test(v) },
|
||||
{
|
||||
label: "One special character",
|
||||
test: (v: string) => /[^A-Za-z0-9]/.test(v),
|
||||
},
|
||||
] as const;
|
||||
|
||||
/**
|
||||
@@ -21,15 +24,14 @@ export const passwordField = z
|
||||
.regex(/\d/, "Password must include a number")
|
||||
.regex(/[^A-Za-z0-9]/, "Password must include a special character");
|
||||
|
||||
export const confirmPasswordField = z.string().min(1, "Please confirm your password");
|
||||
export const confirmPasswordField = z
|
||||
.string()
|
||||
.min(1, "Please confirm your password");
|
||||
|
||||
export const samePassword = (data: { password: string; confirmPassword: string }) =>
|
||||
data.password === data.confirmPassword;
|
||||
|
||||
export const PASSWORD_MISMATCH = {
|
||||
message: "Passwords do not match",
|
||||
path: ["confirmPassword"],
|
||||
} as const;
|
||||
export const samePassword = (data: {
|
||||
password: string;
|
||||
confirmPassword: string;
|
||||
}) => data.password === data.confirmPassword;
|
||||
|
||||
/** Every requirement in {@link passwordRequirements} is satisfied. */
|
||||
export const meetsAllRequirements = (value: string) =>
|
||||
|
||||
Reference in New Issue
Block a user