Question: I'm setting up Amazon Cognito user pools as means to authenticate my users.
Cognito sends verification emails (password reset, confirm email address etc.).
Cognito uses Amazon SES for sending emails and Amazon SES is limited to 200 daily email quota per day.
I'm afraid that once I've imported all my users to Amazon Cognito, resulting with each of them receiving a couple of emails upon their next login, I'll be well over the quota and they will not be able to receive those emails.
Does anyone know whether this quota applies to automatic emails by Amazon Cognito?

Answer: 
Solved the issue with async / await and promise

The LoginService first import toPromise:

```
import 'rxjs/add/operator/toPromise';

```

Then created an async method in the LoginService

```
  async isAuthenticated(){
     const response = await this.http.get('/login/authenticated').toPromise();
     return response.json();
  }

```

Then in the component: 

```
async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
    this.loginStatus = await this.loginService.isAuthenticated();

    console.log("LOGGED IN STATUS: " + this.loginStatus);

    if (this.loginStatus == true){
        return true;
    }

    // not logged in so redirect to login page with the return url
    this.router.navigate(['/layout/login'], { queryParams: { returnUrl: state.url } });    
}

```
You can return the observable as `Observable<boolean>`

```
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
    return this.loginService.isAuthenticated()
        .map(status => {
            console.log(status);
            this.authenticated = status;
            return true;
        }).catch((err) => {
            console.log(err);
            return Observable.of(false);
        });
}

```