Check password complexity during registration
This adds a password complexity rule during registration to require strong passwords. This is based on the `zxcvbn` module that we already use for key backup passphrases. In addition, this also tweaks validation more generally to allow rules to be async functions.
This commit is contained in:
parent
008ca3543b
commit
4f41161a47
5 changed files with 77 additions and 26 deletions
|
@ -87,12 +87,12 @@ export default class Field extends React.PureComponent {
|
|||
this.input.focus();
|
||||
}
|
||||
|
||||
validate({ focused, allowEmpty = true }) {
|
||||
async validate({ focused, allowEmpty = true }) {
|
||||
if (!this.props.onValidate) {
|
||||
return;
|
||||
}
|
||||
const value = this.input ? this.input.value : null;
|
||||
const { valid, feedback } = this.props.onValidate({
|
||||
const { valid, feedback } = await this.props.onValidate({
|
||||
value,
|
||||
focused,
|
||||
allowEmpty,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue