# Integrate the app with Cognito User Pool

Now that we have a user pool and app client, we can put those configurations in our app and give it a quick test.

* Copy the `cognito pool id` in app-config.js
* Copy the `App client id` in app-config.js
* Make sure you have set correct `region` in the app-config.js as well.

Move the changes to the S3 bucket again. If I am doing a simple test around S3, I usually prefer the `s3 sync` command which can easily move the changed files to the S3 bucket instead of doing full copy or integrate other SDK.

```
$ aws s3 sync . s3://<your bucket> --profile <AWS profile name>
```

Reload the page and it will not show any errors.&#x20;

At this stage, a user can go to the `Register` option and signup.&#x20;

{% hint style="success" %}
Please use a valid email address, as the Cognito will send a verification email to complete the signup.
{% endhint %}

Once the signup and verification part is done, do the login. You should be able to log in fine but the application will now show an error message of **invalid identity pool**.

This is because we are trying to capture the Cognito Identity attached to the logged-in user and configure our session to use other AWS services.

```
userPool = new AmazonCognitoIdentity.CognitoUserPool(poolData);
cognitoUser = userPool.getCurrentUser();
```

![Missing Identity Pool error](https://1642315733-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCam2LtfwWxgwwpbHcu%2F-MCeAx3RZvN8DlEtCEVO%2F-MCeCeyXzHcYmUxsq3Vd%2FScreen%20Shot%202020-07-20%20at%208.43.39%20AM.png?alt=media\&token=8eeee25c-bbba-4c2e-a525-2e9a8b061c8e)
