Hi
I am trying to validate my user_meta_data in pre-registrtion action and show an appropriate error message if the check fails and stop the signup flow.
exports.onExecutePreUserRegistration = async (event, api) => {
if (event.user.user_metadata.orgId === '12') {
api.access.deny('no_signups_from_north_america', "Invalid org Id");
}
(the check is only for testing purpose).
In the logs I can see the response sending back my error message as
{"name":"InternalExtensibilityError","statusCode":400,"code":"extensibility_error","message":"no_signups_from_north_america","friendly_message":"Invalid orgId.","description":"no_signups_from_north_america","fromSandbox":true}
But on the signup page it displays “WE’RE SORRY, SOMETHING WENT WRONG WHEN ATTEMPTING TO SIGN UP.” and not the message I am sending.
Is there something I am missing here.