docs
docs copied to clipboard
Add callout for Auth.currentAuthenticatedUser not including user data unless aws.cognito.signin.user.admin is included in access token
Describe the bug
Auth.currentAuthenticatedUser does not include user attributes and/or metadata unless the user's access token includes the aws.cognito.signin.user.admin scope.
To Reproduce Steps to reproduce the behavior:
- Configure OAuth flow for a social provider, omitting the
aws.cognito.signin.user.adminscope - Call
Auth.currentAuthenticatedUserand try to access attributes from it - Observe no attributes present
- If Amplify.Logger is enabled, you will see this printed to the console
Expected behavior There should be a callout in the documentation for Auth.currentAuthenticatedUser describing this behavior and why the scope is needed
Additional context Related to https://github.com/aws-amplify/amplify-js/issues/9972