Unable to get current attributes and their values from Cognito
Here is the complete flow of what I did
- successfully logged in with aws-amplify
- const cognitoUser = await Auth.currentAuthenticatedUser(); console.log("cognitoUser", cognitoUser);
- got the Cognito user attributes info which is all correct (name, sub, email, email_verified)
- called a backend API to update the user info (added one more attribute "profile": 1)
- checked from Cognito user pool, it was successfully added and "profile": 1 was there
- again I did const cognitoUser = await Auth.currentAuthenticatedUser(); console.log("cognitoUser", cognitoUser);
- got the old result again (name, sub, email, email_verified). "profile": 1 was not there
- successfully signed out with aws-amplify
- logged in again
- the keys this time got from the console.log are (name, sub, email, email_verified, profile)