Skip to content

Instantly share code, notes, and snippets.

@saltukalakus
Created November 2, 2019 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saltukalakus/7f104d0f1b4bb894a2cc694d0aef8d71 to your computer and use it in GitHub Desktop.
Save saltukalakus/7f104d0f1b4bb894a2cc694d0aef8d71 to your computer and use it in GitHub Desktop.
Welcome Sent message
function (user, context, callback) {
// If the connection isn't email passwordless return
if (context.connection !== "email") {
return callback(null, user, context);
}
if (user.app_metadata && user.app_metadata.welcomeSent) {
return callback(null, user, context);
}
// Save the welcomeSent to app_metadata
user.app_metadata.welcomeSent = true;
auth0.users.updateAppMetadata(user.user_id, user.app_metadata)
.then(function(){
callback(null, user, context);
})
.catch(function(err){
callback(err);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment