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);