I’m trying to control the behaviour of Universal Login page in the reaction to errors encounter during the user migration.
In the database script, I send a validation error when I cannot migrate the user.
function login(email, password, callback) {
// [...]
return callback(new ValidationError('custom_validation_error_code', 'message'));
}
I would like to inform the user about the specific issue with this migration of this account when login and password are valid.
I can do that by showing the right message but I would like also to do a few additional operations in JS.
var lock = new Auth0Lock([...]);
lock.on("authorization_error", function(error) {
/// [...] code to control behaviour of the page
});
// below code will not work beacuse it doesn't recognise `custom_validation_error_code` as an event.
lock.on("custom_validation_error_code", function(error){
/// [...] code to control behaviour of the page
});
Unfortunately, Lock doesn’t provide the possibility to react to such a event. Is there any possibility react in javascript on a custom validation error?