what is difference between currentAuthenticatedUser() and currentUserPoolUser() in AWS Amplify?

Viewed 686
3 Answers

From the code, it looks like currentAuthenticatedUser checks for federation info. However, if it doesn't find federation info, it just calls currentUserPoolUser. So I'd say call currentUserPoolUser if you know you're never going to be using federated logins, but you should probably call currentAuthenticatedUser if there's a chance you might.

according to amplify auth docs, both result in "A promise resolves to current authenticated CognitoUser if success"

Related