1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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"];
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor einem Jahr
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 !