I wasn’t able to find a solution here or elsewhere:
- My React app is wrapped in the Auth0Provider from @auth0/auth0-react.
- I have an auth0 object in props with keys such as ‘error’, 'getAccessTokenSilently, ‘isAuthenticated’, ‘isLoading’… etc. including my ‘user’ object.
- The user object contains the usual keys (email, name, nickname…etc), but NOT the user_metadata as I expect after setting a rule to do so.
- The rule I have set is:
function (user, context, callback) { user.user_metadata = user.user_metadata || {}; context.idToken[`user_metadata`] = user.user_metadata; callback(null, user, context); }
I want to be able to call this.props.auth0.user.user_metadata from my app as I can with the other key values from the user object that persist.
Thanks in advance for any help.