AI Implementation feature(821): First-Start Create Admin Modal (#2)
This commit was merged in pull request #2.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
export interface PasswordMatchGroupLike {
|
||||
get(name: 'password' | 'passwordConfirm'): { value: string | null | undefined } | null;
|
||||
}
|
||||
|
||||
export interface PasswordMatchResult {
|
||||
passwordMismatch?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Group-level validator for the "Confirm Password" field.
|
||||
* Returns `{ passwordMismatch: true }` when the two values differ,
|
||||
* or `null` when they match (or when either is empty, so that
|
||||
* `required`/`minlength` validators can take over).
|
||||
*/
|
||||
export function passwordMatchValidator(group: PasswordMatchGroupLike): PasswordMatchResult | null {
|
||||
const password = group.get('password')?.value;
|
||||
const confirm = group.get('passwordConfirm')?.value;
|
||||
if (!password || !confirm) return null;
|
||||
return password === confirm ? null : { passwordMismatch: true };
|
||||
}
|
||||
Reference in New Issue
Block a user