mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 17:21:41 +10:00
fix: improve the validation message for documenso app (#640)
* fix: improve the validation message * fix: improve the validation message --------- Co-authored-by: Catalin Pit <catalinpit@gmail.com>
This commit is contained in:
@ -20,9 +20,18 @@ import { FormErrorMessage } from '../form/form-error-message';
|
||||
|
||||
export const ZPasswordFormSchema = z
|
||||
.object({
|
||||
currentPassword: z.string().min(6).max(72),
|
||||
password: z.string().min(6).max(72),
|
||||
repeatedPassword: z.string().min(6).max(72),
|
||||
currentPassword: z
|
||||
.string()
|
||||
.min(6, { message: 'Password should contain at least 6 characters' })
|
||||
.max(72, { message: 'Password should not contain more than 72 characters' }),
|
||||
password: z
|
||||
.string()
|
||||
.min(6, { message: 'Password should contain at least 6 characters' })
|
||||
.max(72, { message: 'Password should not contain more than 72 characters' }),
|
||||
repeatedPassword: z
|
||||
.string()
|
||||
.min(6, { message: 'Password should contain at least 6 characters' })
|
||||
.max(72, { message: 'Password should not contain more than 72 characters' }),
|
||||
})
|
||||
.refine((data) => data.password === data.repeatedPassword, {
|
||||
message: 'Passwords do not match',
|
||||
|
||||
Reference in New Issue
Block a user