Skip to content

Commit

Permalink
feat: Add zxcvbn user_inputs prop
Browse files Browse the repository at this point in the history
* feature-user-inputs

* Read me Update
  • Loading branch information
hallowcard13 authored and apertureless committed Oct 4, 2019
1 parent 4437cec commit f0cc239
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 8 additions & 1 deletion src/components/PasswordStrengthMeter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@
labelHide: {
type: String,
default: 'Hide Password'
},
/**
* @type String
*/
userInputs: {
type: Array,
default: []
}
},
data () {
Expand Down Expand Up @@ -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
},
/**
Expand Down

0 comments on commit f0cc239

Please sign in to comment.