Skip to content

Commit f0cc239

Browse files
hallowcard13apertureless
authored andcommitted
feat: Add zxcvbn user_inputs prop
* feature-user-inputs * Read me Update
1 parent 4437cec commit f0cc239

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Interactive password strength meter based on [zxcvbn](https://github.com/dropbox
117117
| labelHide | String | 'Hide Password' | Label for the hide icon
118118
| labelShow | String | 'Show Password' | Label for the show icon
119119
| autocomplete | String | 'new-password' | Input field autocomplete property
120+
| userInput | Array | empty array | Array of strings that zxcvbn will treat as an extra dictionary
120121

121122
## Events
122123

src/components/PasswordStrengthMeter.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@
250250
labelHide: {
251251
type: String,
252252
default: 'Hide Password'
253+
},
254+
/**
255+
* @type String
256+
*/
257+
userInputs: {
258+
type: Array,
259+
default: []
253260
}
254261
},
255262
data () {
@@ -281,7 +288,7 @@
281288
* @return {Number} Password Strength Score
282289
*/
283290
passwordStrength () {
284-
return this.password ? zxcvbn(this.password).score : null
291+
return this.password ? zxcvbn(this.password, (this.userInputs.length >= 1 ? this.userInputs : null)).score : null
285292
},
286293
287294
/**

0 commit comments

Comments
 (0)