Auth0 Home Blog Docs

I just want to POST user details in pardot after the user registration

authentication-api
auth0
login
hooks
post-user-registrati

#1

hello everyone,

I just want to POST user details in pardot after the user registration. to accomplish this requirement I have created a post-registration hook.

module.exports = function(user, context, cb) {
// Perform any asynchronous actions, e.g. send notification to Slack.
request({
method: ‘POST’,
url: ‘https:/demo/api’,
headers: {
‘Content-Type’: ‘application/json’,
},
body: { "email": "demo@email.com", "last_name": "last name", "first_name": "First name", "company":"Company" }
}, function(error, response, body) {
console.log(user)
console.log(context)
cb(error, response)
});
};

Not sure what’s wrong with this, is it related to functionality or data binding?

Error Response

{
“code”: 500,
“error”: “Script generated an unhandled asynchronous exception.”,
“details”: “ReferenceError: request is not defined”,
“name”: “ReferenceError”,
“message”: “request is not defined”,
“stack”: “ReferenceError: request is not defined\n at module.exports (/data/io/50601455-8df8-48c5-8fc7-93a43bf9660d/webtask.js:3:1)\n at /data/sandbox/node_modules/auth0-ext-compilers/lib/compilers/user-registration.js:30:16\n at Object.is_authorized (/data/sandbox/node_modules/auth0-ext-compilers/lib/authorization.js:13:81)\n at userRegistrationHandler (/data/sandbox/node_modules/auth0-ext-compilers/lib/compilers/user-registration.js:9:18)\n at /data/sandbox/node_modules/auth0-ext-compilers/lib/adapter.js:90:20\n at finish (/data/sandbox/node_modules/auth0-ext-compilers/node_modules/wreck/lib/index.js:369:16)\n at wrapped (/data/sandbox/node_modules/auth0-ext-compilers/node_modules/wreck/node_modules/hoek/lib/index.js:879:20)\n at onReaderFinish (/data/sandbox/node_modules/auth0-ext-compilers/node_modules/wreck/lib/index.js:415:16)\n at g (events.js:260:16)\n at emitNone (events.js:72:20)”
}

Please Help me :frowning: