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
424 stars 232 forks source link

Fixed TokenScopes being removed when calling getSession() #119

Closed mymattcarroll closed 10 months ago

mymattcarroll commented 6 years ago

Issue #, if available:

Description of changes: this.signInUserSession = this.getCachedSession(); is now run in the constructor of class CognitoAuth. After that line the token scopes are also set on this.signInUserSession. Once constructed, when calling getSession(), this line is currently run again: this.signInUserSession = this.getCachedSession();. If the browser has not cached the token scopes yet, they will be reset to an empty array.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.