Closed glangston83 closed 7 years ago
Have you included all of the required libraries per this following instructions? https://github.com/aws/amazon-cognito-identity-js
I posted this issue with https://github.com/aws/amazon-cognito-identity-js/issues/160#issuecomment-249733150 and replied back on https://github.com/bitwiseshiftleft/sjcl/issues/316 that there was still an issue. I have been unable to make headway on this and zone.js makes it impossible to find where it coming from. I have configured everything as requested for amazon-cognito-identity-js and ensured that codecBytes was included in the SJCL build. So any help would be appreciated.
The only time I saw this was when I updated my libraries to the latest versions. What I had to do is update ALL of the cognito-related libraries to the latest version. So try going to the link above and update all of the libraries:
<script src="/path/to/jsbn.js"></script>
<script src="/path/to/jsbn2.js"></script>
<script src="/path/to/sjcl.js"></script>
<script src="/path/to/aws-cognito-sdk.min.js"></script>
<script src="/path/to/amazon-cognito-identity.min.js"></script>
<script src="/path/to/aws-sdk-2.3.5.js"></script>
I took it a step further and updated to aws-sdk-2.6.* and it worked.
Please report back whether that worked (it did for me).
This is an issue with angular-cli and how it is loading scripts for webpack in the angular-cl.json file. SJCL is null in the amazon-cognito-identity.min.js file. I pulled down the amazon-cognito-identity-js project. Rebuilding amazon-cognito-identity.min.js so that SJCL is set to false for excluding 3rd party in the webpack.config.js file fixes this. Obviously forcing a 3rd party to included in the build is less than desirable but it does fix it for now.
Updated to angular 2.1.1
@vbudilov I have the same issue, how did you fix it? thx
@mixxr ,
Try getting the latest version of this code. I've made many upgrades, including the aws sdk js version.
If you include these files via angular-cli.json scripts array, you continue to get this error. A workaround is to list them separately in the root index.html file (as shown in this quick start).
We're able to register, and confirm. When we attempt login however, we're getting the following:
EXCEPTION: Error in ./LoginComponent class LoginComponent - inline template:18:12 caused by: Cannot read property 'hex' of undefined
Issue seems to hit at this line: cognitoUser.authenticateUser(authenticationDetails, {