amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
423 stars 232 forks source link

CognitoAuth username is empty in code grant flow #59

Open zaccyee opened 6 years ago

zaccyee commented 6 years ago

When using token flow, CognitoAuth property username returns a string of uuid. When using code grant flow, username is empty or undefined. Is this expected?

Which CognitoAuth properties or methods should I use to check if a user has signed in?

yuntuowang commented 6 years ago

Hi, @zaccyee when using code grant flow, username should be not empty or undefined. It is a bug which my code fix already in review. Fix will be pushed soon!

Currently, we don't provide a API to check if a user has signed in. Here the pull request: https://github.com/aws/amazon-cognito-auth-js/pull/14/commits/c2ee47c5d5065ed99bfcf277dfee0b2f257f3c38

You can see this as a good example, we may merge this PR really soon too!

Let me know if you have any other questions and thanks!!

yuntuowang commented 6 years ago

Hi @zaccyee, our bug fix has been pushed! Please use version v1.1.1, you can download directly from github or use npm to install the latest version. Thanks!!