I am trying to add user id and username into database upon user post registration.
If I do console.log(user)
I am getting the following result.
{
tenant: 'wallora-test',
email: 'dbjudwdujw@gmail.com',
emailVerified: false,
id: '61542dc66ae3cb0068f5670b'
}
There seems to be no username and some other properties as shown comments of the editor
Here’s what I wrote into the editor
/**
@param {object} user - The user being created
@param {string} user.id - user id
@param {string} user.tenant - Auth0 tenant name
@param {string} user.username - user name
@param {string} user.email - email
@param {boolean} user.emailVerified - is e-mail verified?
@param {string} user.phoneNumber - phone number
@param {boolean} user.phoneNumberVerified - is phone number verified?
@param {object} user.user_metadata - user metadata
@param {object} user.app_metadata - application metadata
@param {object} context - Auth0 connection and other context info
@param {string} context.requestLanguage - language of the client agent
@param {object} context.connection - information about the Auth0 connection
@param {object} context.connection.id - connection id
@param {object} context.connection.name - connection name
@param {object} context.connection.tenant - connection tenant
@param {object} context.webtask - webtask context
@param {function} cb - function (error, response)
*/
module.exports = async function (user, context, cb) {
const fetch = require("node-fetch");
console.log(user)
await fetch(`https://************`, {
method: "POST",
headers: {"Content-Type": "application/json" },
body: JSON.stringify(***********)
});
cb();
};
Note the query works fine , when I have added hard coded string values for id and name field in the body (hidden here).