1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
1
You can't directly destructure it like you do with built-in attributes because of the colon in its name. Instead, access it using bracket notation. Here’s how you can do it:
const userAttributes = await fetchUserAttributes(); const category = userAttributes["custom:category"];
Contenus pertinents
- Réponse acceptéedemandé il y a un an
- demandé il y a 7 mois
- demandé il y a un an
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 2 ans
I did it using : "const { tokens, credentials, identityId, userSub } = await fetchAuthSession(); const { idToken, accessToken } = tokens; idToken.payload['custom:category']" but I prefer your way. Thank you !