Pre registration hook - extensibility error

I have created pre registration hook and called out internal api to validate user but Its not allowing to create user after api successfully validated.

The following is the network call from browser developer tool

https://pearl-dev.eu.auth0.com/dbconnections/signup

{“name”:“InternalExtensibilityError”,“statusCode”:400,“code”:“extensibility_error”,“message”:“Extensibility error”,“description”:“Extensibility error”,“fromSandbox”:true}

Hi @sai.krishna,

Welcome to the Auth0 Community!

This suggests there is an error from an extensibility tool like hooks. You should be able to see the logs by following this guide:

You may also want to consider using an Action instead of a hook, as Actions will eventually replace hooks.

1 Like

Hi Dan,

I have tried Action instead of hook and it is working as intended.

Thanks

1 Like

Great, let us know if you have any other questions.

Hi Dan,

we are getting error in pre user registration action if we use the following code as mentioned in the document

exports.onExecutePreUserRegistration = async (event, api)

error:
"code": 400,
"error": "Script returned an error.",
"details": "Error: No function found. Make sure you export it using \"module.exports = async function(event, context) { }\"",
"name": "Error",
"message": "No function found. Make sure you export it using \"module.exports = async function(event, context) { }\"",
"stack": "Error: No function found. Make sure you export it using \"module.exports = async function(event, context) { }\"\n at module.exports (/data/io/node12/7d13bcb6-24dc-4a4a-b8dc-b5a17c66fe13/webtask.js:159:7)\n at v1WebtaskWrapper (/data/io/65321e3f93af0d589dc791c85863346264b58e5d.js:121:16)\n at Async.waterfall.Errors.create.code (/data/sandbox/lib/sandbox.js:617:25)\n at nextTask (/data/sandbox/node12/node_modules/async/dist/async.js:5324:14)\n at next (/data/sandbox/node12/node_modules/async/dist/async.js:5331:9)\n at /data/sandbox/node12/node_modules/async/dist/async.js:969:16\n at /data/sandbox/lib/sandbox.js:496:22\n at /data/sandbox/lib/sandbox.js:704:16\n at invokeCallback (/data/sandbox/node12/node_modules/raw-body/index.js:224:16)\n at done (/data/sandbox/node12/node_modules/raw-body/index.js:213:7)"

if we make change the function as in error says its working
module.exports = async (event, api)

why so? anything I missed, please suggest.

Can you please DM me your tenant name?

If I try to recreate, I get an error when using module.exports, and everything is fine with the standard exports.onExecutePreUserRegistration. Are you getting the error if you use the test functionality in the editor, or in the log if you have a use sign up?