Update static files


The /js/config.js file contains settings for:

  • User Pool ID
  • App client ID
  • Region

Update this file with the settings from the User Pool and App Client you have created in the previous steps and commit the file back to your git repository.

  • Step 1: Go back to your AWS Cloud9 Enviroment
  • Step 2: Open js/config.js
  • Step 3: Update the cognito section with the correct values for the User Pool ID and App Client ID you just created. (Region should be the AWS Region code where you created your user pool)
//--> js/config.js
window._config = {
    cognito: {
        userPoolId: 'USER_POOL_ID', // e.g. us-east-2_uXboG5pAb
        userPoolClientId: 'APP_CLIENT_ID', // e.g. 25ddkmj4v6hfsfvruhpfi7n4hv
        region: 'REGION_CODE' // e.g. us-east-2
    },
    api: {
        invokeUrl: ''
    }
};
  • Step 4: Save the modified file, making sure the file name is still config.js
  • Step 5: Commit the changes to your git repository

Amplify should pick up the changes and begin building and deploying your web application

In this module, instead of having you write the browser-side code for managing the registration, verification, and sign in flows, we provide a working implementation in the assets you deployed in the first module. The cognito-auth.js file contains the code that handles UI events and invokes the appropriate Amazon Cognito Identity SDK methods.