make password match rule reusable

This commit is contained in:
Athou
2026-01-20 08:54:23 +01:00
parent afe957ba59
commit 3c8ac35a46
31 changed files with 32 additions and 59 deletions

View File

@@ -11,5 +11,7 @@ export function useValidationRules() {
value && minimumPasswordLength && value.length < minimumPasswordLength
? _(msg`Password must be at least ${minimumPasswordLength} characters`)
: null,
passwordConfirmation: (newPasswordConfirmation: string | undefined, newPassword: string | undefined) =>
newPasswordConfirmation && newPasswordConfirmation !== newPassword ? _(msg`Passwords do not match`) : null,
}
}