Hi Team,
I am trying to test a slack code in post user registration hook with the below code and run via console itself.Its returning the below error.Can any one help me?
Request :
module.exports = function (user, context, cb) {
var SLACK_HOOK =“#URL”;
// Post the new user’s name and email address to the selected channel
var slack = require(‘slack-notify’)(SLACK_HOOK);
var message = ‘New User: ’ + (user.email) + ’ (’ + user.email + ‘)’;
var channel = ‘#CHANNEL’;
slack.success({
text: message,
channel: channel
});
console.log(“success”);
cb(message);
};
RESPONSE :
"message": "New User: user1@foo.com (user1@foo.com)",
"statusCode": 500,
"stack": "Error: New User: user1@foo.com (user1@foo.com)\n at respondWithError (/data/sandbox/node_modules/auth0-ext-compilers/lib/adapter.js:11:17)\n at buildResponse (/data/sandbox/node_modules/auth0-ext-compilers/lib/adapter.js:96:24)\n at func (/data/sandbox/node_modules/auth0-ext-compilers/lib/compilers/user-registration.js:31:20)\n at module.exports (/data/io/27e9ebc9-6a28-4784-a88d-85492b8359eb/webtask.js:19:3)\n at Authz.is_authorized.error (/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 parseBody (/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/hoek/lib/index.js:879:20)"
}
Please can any one help?