Access user_metadata from signup with additionalSignupFields?

I was going through Lock Configuration and successfully added additionalSignUpFields which rendered on my signup page. In the documentation it says that they are added to user_metadata but when I subscribe to user profile on my Angular app it doesn’t have any metadata, just the standard fields like this:

{
“nickname”:
“name”:
“picture”:
“email”:
“email_verified”:
“sub”:
}

Any help?

Hey there!

I guess it might be coming from the fact that those values are saved in user_metadata not app_metadata

Hey, thanks for the answer but it was the fact that I didn’t create a rule to enrich User’s id token with metadata like this:

function (user, context, callback) {
var namespace = “https://example/”;
user.user_metadata = user.user_metadata || {};
context.idToken[namespace + “user_metadata”] = user.user_metadata;
callback(null, user, context);
}

1 Like

Perfect! Glad you have figured it out and thanks for sharing with the rest of community!

Just posted a new topic but it would be even better if you could help :slight_smile:
So I managed to do that, but now I should add that User object to my local SQL Server database(just without password). How do I accomplish that?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.