private subscribeToAuthChanges()

in ui-angular/src/app/app.component.ts [192:215]


  private subscribeToAuthChanges() {

    Hub.listen('auth', async ({payload: {event, data}}) => {
      switch (event) {
        case 'signIn':
        case 'cognitoHostedUI':
          // workaround for FF bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1422334
          // eslint-disable-next-line
          // noinspection SillyAssignmentJS
          window.location.hash = window.location.hash;
          await this.onLoad();

          break;
        case 'signIn_failure':
        case 'cognitoHostedUI_failure':
          this.model.user = undefined;
          console.warn(data);
          break;
        default:
          break;
      }
    });

  }