'AWS Cognito user's attributes differ between CognitoUser object and CognitoUserSession sub-object

Dev Console showing CognitoUser object obtained from amplify's Auth.currentAuthenticatedUser()

In there, you can see the CognitoUser object shows two different values for the same user attribute. The "{}" is the previous value. The value in the CognitoUserSession is correct. Also, the user actually has another value that is not showing up anywhere here:

Actual User attributes in AWS

When I call adminGetUserAttributes on the backend, everything shows up correctly.

Can anyone explain why there is a mismatch here and possibly how to correct it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source