Skip to content
Snippets Groups Projects
Commit c5cf678c authored by Tom Lutzenberger's avatar Tom Lutzenberger
Browse files

#1058862: Adjust password validation to tools-API

parent 2a9f65a1
No related branches found
No related tags found
No related merge requests found
......@@ -8,11 +8,11 @@ import("system.vars");
if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) {
let newPassword = vars.get("$local.value");
let policyMessages = tools.validatePasswordPolicies(newPassword);
let policyMessages = tools.validatePasswordPolicies(newPassword, "");
let messages = [];
if(newPassword) {
if(Object.keys(policyMessages).length > 0) {
if(policyMessages.length > 0) {
for(let msg in policyMessages) {
messages.push(policyMessages[msg]);
}
......
......@@ -6,7 +6,7 @@ import("system.vars");
let newPassword = vars.get("$local.value");
let currentPassword = vars.get("$field.currentPassword");
let policyMessages = tools.validatePasswordPolicies(newPassword);
let policyMessages = tools.validatePasswordPolicies(newPassword, vars.get("$sys.user"));
let messages = [];
if(newPassword) {
......@@ -14,7 +14,7 @@ if(newPassword) {
result.string(translate.text("New password must not be the same as the current password"));
}
if(Object.keys(policyMessages).length > 0) {
if(policyMessages.length > 0) {
for(let msg in policyMessages) {
messages.push(policyMessages[msg]);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment