amazon-cognito-auth-js
amazon-cognito-auth-js copied to clipboard
Fixed TokenScopes being removed when calling getSession()
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.