Hello, I’m trying to add a user data to my app delevloped with Angular 5.
I add the login with auth0. I’d like to add some infos when I login like company name.
I follow this link, but i’m not able…
I insert the data on user_metadata
“Company”:“Example”
I create a new rule clicking on “Add Persistent Attributes To The User” with the following code:
function (user, context, callback) {
user.user_metadata = user.user_metadata || {};
user.user_metadata.cocompanylor = user.user_metadata.company || 'Error';
context.idToken['https://example.com/favorite_color'] = user.user_metadata.company;
auth0.users.updateUserMetadata(user.user_id, user.user_metadata)
.then(function(){
callback(null, user, context);
})
.catch(function(err){
callback(err);
});
}
All works but I saw https://example.com/favorite_color and I see the result if I print con console all the profile.
But I want to assign property Company to my local variable…
I tried this.profile.user_metadata but it doesn’t work
How can I do that?