-
-
Save dnationalwala-pm/f03704161b718432bb4f787583653800 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handler that will be called during the execution of a PostUserRegistration flow. | |
* | |
* @param {Event} event - Details about the context and user that has registered. | |
* @param {PostUserRegistrationAPI} api - Methods and utilities to help change the behavior after a signup. | |
*/ | |
exports.onExecutePostUserRegistration = async (event, api) => { | |
const ManagementClient = require('auth0').ManagementClient; | |
const management = new ManagementClient({ | |
domain: event.secrets.domain, | |
clientId: event.secrets.clientId, | |
clientSecret: event.secrets.clientSecret, | |
}); | |
var params = { id: event.user.user_id }; | |
console.log('params >>>> ', params); | |
var metadata = { | |
address: '123th Node.js Street' | |
}; | |
management.updateUserMetadata(params, metadata, function (err, user) { | |
if (err) { | |
console.log(err); | |
} | |
// Updated user. | |
console.log('user: ??? ', user); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment