Merge pull request #4055 from ssilvert/regex-trunc
KEYCLOAK-4402: Fix regexp password policy.
This commit is contained in:
commit
e85d8774da
1 changed files with 5 additions and 2 deletions
|
@ -468,12 +468,14 @@ module.controller('RealmPasswordPolicyCtrl', function($scope, Realm, realm, $htt
|
|||
value = null;
|
||||
} else {
|
||||
id = policyToken.substring(0, policyToken.indexOf('('));
|
||||
value = policyToken.substring(policyToken.indexOf('(') + 1, policyToken.indexOf(')')).trim();
|
||||
value = policyToken.substring(policyToken.indexOf('(') + 1, policyToken.lastIndexOf(')')).trim();
|
||||
}
|
||||
|
||||
for (var j = 0; j < serverInfo.passwordPolicies.length; j++) {
|
||||
if (serverInfo.passwordPolicies[j].id == id) {
|
||||
var p = serverInfo.passwordPolicies[j];
|
||||
// clone
|
||||
var p = JSON.parse(JSON.stringify(serverInfo.passwordPolicies[j]));
|
||||
|
||||
p.value = value && value || p.defaultValue;
|
||||
policies.push(p);
|
||||
}
|
||||
|
@ -502,6 +504,7 @@ module.controller('RealmPasswordPolicyCtrl', function($scope, Realm, realm, $htt
|
|||
$scope.serverInfo = serverInfo;
|
||||
|
||||
$scope.changed = false;
|
||||
console.log(JSON.stringify(parse(realm.passwordPolicy)));
|
||||
$scope.policy = parse(realm.passwordPolicy);
|
||||
var oldCopy = angular.copy($scope.policy);
|
||||
|
||||
|
|
Loading…
Reference in a new issue