Skip to content

Commit

Permalink
chore(package): update ember-cli-password-strength to version 2.0.0 (#…
Browse files Browse the repository at this point in the history
…1490)

* chore(package): update ember-cli-password-strength to version 2.0.0

Closes #1458

* Migrate app to new version of ember-cli-password-strength
  • Loading branch information
joshsmith authored and begedin committed Dec 27, 2017
1 parent 98ddd4b commit 48325ed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions app/components/signup-password-input.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
import { computed, get } from '@ember/object';
import { not, lt, gte, alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import strength from 'password-strength';

export default Component.extend({
classNames: ['input-group'],

ajax: service(),
passwordStrength: service(),

canShowValidations: alias('isNotEmpty'),
isEmpty: lt('passwordLength', 1),
Expand All @@ -23,8 +23,8 @@ export default Component.extend({
}),

strength: computed('password', function() {
let password = this.get('password') || '';
return strength(password);
let passwordStrength = get(this, 'passwordStrength');
return passwordStrength.strengthSync(get(this, 'password'));
}),

strengthPercentage: computed('isValid', 'passwordLength', 'strength', function() {
Expand Down
3 changes: 3 additions & 0 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ module.exports = function(defaults) {
// async, await, etc.
includePolyfill: true
},
'ember-cli-password-strength': {
bundleZxcvbn: true
},
fingerprint: fingerprintOptions,
emberCLIDeploy: {
// runOnPostBuild: (env === 'development') ? 'development-postbuild' : false,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"ember-cli-moment-shim": "^3.4.0",
"ember-cli-neat": "^0.0.6",
"ember-cli-page-object": "1.12.1",
"ember-cli-password-strength": "1.0.3",
"ember-cli-password-strength": "^2.0.0",
"ember-cli-qunit": "^4.1.1",
"ember-cli-release": "^0.2.9",
"ember-cli-sass": "^7.0.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3008,13 +3008,13 @@ [email protected]:
ember-test-helpers "^0.6.3"
rsvp "^3.2.1"

ember-cli-password-strength@1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/ember-cli-password-strength/-/ember-cli-password-strength-1.0.3.tgz#690a7771bbb6e9c4994a73259df4df785a2287df"
ember-cli-password-strength@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ember-cli-password-strength/-/ember-cli-password-strength-2.0.0.tgz#f6f16d5c42ac16a4605305244f15f092f15224b3"
dependencies:
broccoli-funnel "^1.1.0"
broccoli-merge-trees "^2.0.0"
ember-cli-babel "^6.0.0"
ember-cli-babel "^6.8.0"
zxcvbn "^4.3.0"

ember-cli-path-utils@^1.0.0:
Expand Down

0 comments on commit 48325ed

Please sign in to comment.