Hmm, that’s not my experience currently. What the code you provided did do was make the user meta suddenly available within the response to /userinfo
. The JWT itself does not contain any meta data, so far as I can see.
To be clear, here’s what I’m doing.
(async () => {
//get client
const auth0Client = await auth0.createAuth0Client({
domain: '******',
clientId: '******',
cacheLocation: 'localstorage',
authorizationParams: {
redirect_uri: window.location.origin,
audience: '******'
}
})
//on login callback, strip out A0 QS params
if (location.search.includes('state=') && (
location.search.includes('code=') ||
location.search.includes('error='))
) {
await auth0Client.handleRedirectCallback();
window.history.replaceState({}, document.title, '/');
}
//logged in? Get auth token
const isAuthenticated = await auth0Client.isAuthenticated();
let token;
if (isAuthenticated) token = await auth0Client.getTokenSilently({aud: '******'});
//...
This produces a JWT which, when run through jwt.io, contains the below. Notice it doesn’t have the user meta in the payload, which is what I’m asking and I believe your previous reply said should be there.
The user meta doesn’t show up until I then use that token to call getUser()
, which of course involves an API request to Auth0.