Merge pull request #2194 from matiu/enforce-passwords
Enforce Strong passwords
This commit is contained in:
commit
94d6916a75
5 changed files with 26 additions and 11 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue