const request = require('request');
module.exports = function (user, context, cb) {
console.log('webhook was started for ' + user.email)
request.post({
url: 'http://35.180.70.70/webhook',
body: {
"externalId": user.id,
"firstName": user.username,
"email": user.email,
"phone": user.phoneNumber
},
json: true,
headers : {
"content-type": "application/json"
},
function(error, response, body) {
console.log('-----', user);
console.log(context);
cb(error, response)
}})}
I wrote webhook for “Create user” case
But, when I create a user, I see:
Access to XMLHttpRequest at ‘https://zeway.eu8.webtask.io/user-registration-hook/’ from origin ‘https://manage.auth0.com’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
error
When I send the same request via Postman → works fine