diff --git a/README.md b/README.md index dc058b7..4ac1e7c 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,7 @@ Interactive password strength meter based on [zxcvbn](https://github.com/dropbox | labelHide | String | 'Hide Password' | Label for the hide icon | labelShow | String | 'Show Password' | Label for the show icon | autocomplete | String | 'new-password' | Input field autocomplete property +| userInput | Array | empty array | Array of strings that zxcvbn will treat as an extra dictionary ## Events diff --git a/src/components/PasswordStrengthMeter.vue b/src/components/PasswordStrengthMeter.vue index 8e1e4bc..6a5ae5d 100644 --- a/src/components/PasswordStrengthMeter.vue +++ b/src/components/PasswordStrengthMeter.vue @@ -250,6 +250,13 @@ labelHide: { type: String, default: 'Hide Password' + }, + /** + * @type String + */ + userInputs: { + type: Array, + default: [] } }, data () { @@ -281,7 +288,7 @@ * @return {Number} Password Strength Score */ passwordStrength () { - return this.password ? zxcvbn(this.password).score : null + return this.password ? zxcvbn(this.password, (this.userInputs.length >= 1 ? this.userInputs : null)).score : null }, /**