validate password in the frontend too (#2017)

This commit is contained in:
Athou
2026-01-15 09:44:57 +01:00
parent eb573fdc8b
commit 5a95b95801
36 changed files with 223 additions and 125 deletions

View File

@@ -26,8 +26,13 @@ export function ProfileSettings() {
const form = useForm<FormData>({
validate: {
newPassword: value =>
value && serverInfos && value.length < serverInfos.minimumPasswordLength
? _(msg`Password must be at least ${serverInfos.minimumPasswordLength} characters`)
: null,
newPasswordConfirmation: (value, values) => (value !== values.newPassword ? _(msg`Passwords do not match`) : null),
},
validateInputOnChange: true,
})
const { setValues } = form