Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get user profile data using Auth.currentAuthenticatedUser #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mariusbutuc
Copy link

@mariusbutuc mariusbutuc commented May 14, 2021

In the book, it is said that:

To display the user profile data, we use the Auth.currentAuthenticatedUser method. […]

Yet Auth.currentUserPoolUser is used in the code sample.

The docs describe both currentUserPoolUser and currentAuthenticatedUser very similarly, yet referencing one and then using the other one doesn't help reduce the blurriness between the two main Cognito pieces: user pools and identity pools.

The support knowledge article trying to clarify this distinction also mentions that

User pools are for authentication (identify verification). […]

and at the same time one method has user pool in its name while the other has authenticated. So I didn't find much help in clarifying the distinction here either.

Snippet from the book

4__Introduction_to_Authentication_-_Full_Stack_Serverless

@dabit3 if this PR is going in the opposite direction than intended, please shed some light here. 🙏🏼

mariusbutuc and others added 2 commits May 14, 2021 17:59
In the book, it is said that:

> To display the user profile data, we use the `Auth.currentAuthenticatedUser` method. […]

Yet `Auth.currentUserPoolUser` is used in the code sample.

The docs describe both [currentUserPoolUser] and
[currentAuthenticatedUser] very similarly, yet referencing one and then
using the other one doesn't help reduce the confusion between the two
main Cognito pieces: _user pools_ and _identity pools_.

The [support knowledge article] trying to clarify this distinction also
mentions that

> _User pools_ are for _authentication_ (identify verification). […]

while one method has _user pool_ in its name and the other has _authenticated_.

  [currentAuthenticatedUser]: https://aws-amplify.github.io/amplify-js/api/classes/authclass.html#currentauthenticateduser
  [currentUserPoolUser]: https://aws-amplify.github.io/amplify-js/api/classes/authclass.html#currentuserpooluser
  [support knowledge article]: https://aws.amazon.com/premiumsupport/knowledge-center/cognito-user-pools-identity-pools/
Add this change for the custom auth code in Chapter 5,
as it builds on top of the basic auth in Chapter 4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant