We do currently use a customized version of the classic universal login with Lock.js. Our login name is always a 10 digits customer number and if the number is shorter, it is filled up with leading zeroes. But customers regularly try to login without the leading zeroes and contact our support when their login fails. So we do have a requirement to automatically add the missing zeroes upon login. We tried to do this by adding a javascript that updates the form’s content upon the focusOut&keydown or submit event, but even if the content of the input field is visually changed to the right value, the submitted value is still the original one. I suspect this to be related to the react component nature of the Lock.js. The script looks roughly like this:
function rectifySyntax(el) {
el.value = ‘testOut’;
}
document.addEventListener(“focusout”, function(e){
if(e.target.matches(“input[name=username]”)){
rectifySyntax(e.target);
}
});
I also alternatively looked into the new login experience, but if I understand the capabilities correctly it is not possible to add a custom javascript to this login UI, right?
Does anybody see a possibility to get this requirement solved? Thanks in advance!
thanks for your reply! I’ve tried your approach on a test tenant, but I don’t get the hint on any input that breaks the connection boundaries. Just the usual ‘wrong username and password’ when the authentication fails. Do I need to enable the validation somewhere?