Created
February 7, 2019 21:22
-
-
Save saltukalakus/9f1d95520b987e108aa53a174225cf25 to your computer and use it in GitHub Desktop.
Resave metadata rule
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
function (user, context, callback) { | |
user.user_metadata = user.user_metadata || {}; | |
user.app_metadata = user.app_metadata || {}; | |
// persist the user_metadata and app_metadata again | |
auth0.users.updateUserMetadata(user.user_id, user.user_metadata) | |
.then(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