code problem on sign in sign up

export function dataset1_afterInsert(context) {

$w.onClick(function(){
let hookContext = context; // see below
$w.onReady(function () {
$w(“#input12”).onCustomValidation( (value1,reject)=> {
$w(“#input11”).onCustomValidation( (value2)=> {

if(hookContext!==value1 && hookContext!==value2)
{
reject(“what up”);
}

});
});
});
});
}
why is this code now working for sign in sign up page and how to resolve it …
here we are verifying that if the database already exist for a user so he need not have to sign up again instead he signs in by just entering the emailid and password(#input11 and #input12)

Hi,

the functions dataset1_afterInsert, $w.onReady etc should not be defined as nested but on their own scope, one next to another

Shlomi