I'm working on a react native app with AWS Amplify.
Using fetchUserAttributes() function (from aws-amplify/auth), I get my signed in user info as following :{"custom:category": "particulier", "email": "email@gmail.com", ...}
I'm ok manipulating and displaying basic attributes such as email in the app with the following :
"const userAttributes = await fetchUserAttributes();" and "userAttributes.email".
However, I don't know how to do it with custom attribute such as "custom:category".
I tried to get info with "const {?, email, name, ...} = await fetchUserAttributes();" but, once again, I don't know what to put for category.
I didn't find any information about that in the doc or on any forums.
Thanks in advance !
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 !