Pre-Registration hook not working with API Call

I created a pre-registration hook, was able to test in the sandbox without errors. However when I try to register a user from my actual application it fails with a generic message:

{
  "name": "InternalExtensibilityError",
  "statusCode": 500,
  "code": "server_error",
  "message": "Internal server error",
  "fromSandbox": true
}

Hook code:

var response = {};
  if (user.user_metadata.cmsName && user.user_metadata.cmsPw) {
     var ownerId = 1;
     var oemName = "Test";
     response.user = {
      user_metadata: { facilitycode: user.user_metadata.facilitycode, ownerId: ownerId, oemName: oemName}
    };
  } else {
    return cb('Invalid Signup');
  }
  response.user = user;
  cb(null, response);

Can you clarify where you see that error, e.g. In the Webtask editor logs? If so, a bug was recently fixed where the hook would still run fine, however the error would show up in the editor. You can try copying the Hook code, deleting the Hook from the dashboard, re-creating a new Hook, and paste the code.

This was fixed after the bad mac error was fixed

@ e.alic I am facing the same issue but I don’t understand form your reply what was the fix. Could you please give a hand? Many thanks

@ e.alic I am facing the same issue but I don’t understand form your reply what was the fix. Could you please give a hand? Many thanks