Merge pull request #2194 from matiu/enforce-passwords

Enforce Strong passwords
This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-19 00:42:33 -03:00
commit 94d6916a75
5 changed files with 26 additions and 11 deletions

View file

@ -13,6 +13,8 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
$scope.createStep = 'storage';
$scope.useLocalstorage = false;
$scope.minPasswordStrength = _.isUndefined(config.minPasswordStrength) ?
4 : config.minPasswordStrength;
pinService.makePinInput($scope, 'newpin', function(newValue) {
_firstpin = newValue;

View file

@ -208,7 +208,7 @@ angular.module('copayApp.directives')
var MIN_LENGTH = 8;
var MESSAGES = ['Very Weak', 'Very Weak', 'Weak', 'Medium', 'Strong', 'Very Strong'];
var COLOR = ['#dd514c', '#dd514c', '#faa732', '#faa732', '#5eb95e', '#5eb95e'];
var COLOR = ['#dd514c', '#dd514c', '#faa732', '#faa732', '#16A085', '#16A085'];
function evaluateMeter(password) {
var passwordStrength = 0;
@ -250,10 +250,7 @@ angular.module('copayApp.directives')
scope.$watch(attrs.ngModel, function(newValue, oldValue) {
if (newValue && newValue !== '') {
var info = evaluateMeter(newValue);
element.css({
'border-color': info.color
});
scope[attrs.checkStrength] = info.message;
scope[attrs.checkStrength] = info;
}
});
}