Auth0 Home Blog Docs

User metadata set via API call in backend available on second login

user-metadata
#1

I am setting user metadata on first login via Auth0 Management API call to backend inside a rule.But how do I manage to get the updated metadata in the same login pipeline without requiring a second login.

#2

Hey there @aswin.v, you can read the user metadata by the below call stated in the following metadata doc. I have included a snippet of it below. Please let me know if you have any additional questions on the subject!we have a doc here that dives into

Using the Lock library, you can read the user’s user_metadata properties the same way you would read any other user profile property. This example retrieves the value associated with user_metadata.hobby using the example user metadata listed above:

lock.getUserInfo(accessToken, function(error, profile) {
  if (!error) {
    document.getElementById('hobby').textContent = profile.user_metadata.hobby;
  }
});
closed #4

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