Migrate passwords on registration to new validation
In addition to migrating password fields, this also removes the remaining support for old-style validation in registration now that all checks have been converted.
This commit is contained in:
parent
aaf745ae2a
commit
008ca3543b
4 changed files with 85 additions and 156 deletions
|
@ -52,7 +52,7 @@ export default function withValidation({ description, rules }) {
|
|||
}
|
||||
// We're setting `this` to whichever component hold the validation
|
||||
// function. That allows rules to access the state of the component.
|
||||
// eslint-disable-next-line babel/no-invalid-this
|
||||
/* eslint-disable babel/no-invalid-this */
|
||||
const ruleValid = rule.test.call(this, { value, allowEmpty });
|
||||
valid = valid && ruleValid;
|
||||
if (ruleValid && rule.valid) {
|
||||
|
@ -61,7 +61,7 @@ export default function withValidation({ description, rules }) {
|
|||
results.push({
|
||||
key: rule.key,
|
||||
valid: true,
|
||||
text: rule.valid(),
|
||||
text: rule.valid.call(this),
|
||||
});
|
||||
} else if (!ruleValid && rule.invalid) {
|
||||
// If the rule's result is invalid and has text to show for
|
||||
|
@ -69,9 +69,10 @@ export default function withValidation({ description, rules }) {
|
|||
results.push({
|
||||
key: rule.key,
|
||||
valid: false,
|
||||
text: rule.invalid(),
|
||||
text: rule.invalid.call(this),
|
||||
});
|
||||
}
|
||||
/* eslint-enable babel/no-invalid-this */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue