adds password max chars hint

This commit is contained in:
Christian Beutel
2025-02-16 20:46:31 +01:00
parent 95f78cb89a
commit 307736dfc2
17 changed files with 120 additions and 54 deletions

View File

@@ -34,24 +34,48 @@
extend: validator({
schema: z
.object({
oldPassword: z.string().min(
8,
$_("must-be-at-least-n-characters-long", {
values: { n: 8 },
}),
),
password: z.string().min(
8,
$_("must-be-at-least-n-characters-long", {
values: { n: 8 },
}),
),
passwordConfirm: z.string().min(
8,
$_("must-be-at-least-n-characters-long", {
values: { n: 8 },
}),
),
oldPassword: z
.string()
.min(
8,
$_("must-be-at-least-n-characters-long", {
values: { n: 8 },
}),
)
.max(
72,
$_("must-be-at-most-n-characters-long", {
values: { n: 72 },
}),
),
password: z
.string()
.min(
8,
$_("must-be-at-least-n-characters-long", {
values: { n: 8 },
}),
)
.max(
72,
$_("must-be-at-most-n-characters-long", {
values: { n: 72 },
}),
),
passwordConfirm: z
.string()
.min(
8,
$_("must-be-at-least-n-characters-long", {
values: { n: 8 },
}),
)
.max(
72,
$_("must-be-at-most-n-characters-long", {
values: { n: 72 },
}),
),
})
.refine((d) => d.password === d.passwordConfirm, {
message: "passwords-must-match",