function logout () {
  clearTimeout(logoutTimer)
  logoutTimer = undefined
  if (store.idToken) {
    store.resetUserData()
    window.localStorage.clear()

    if (cognitoDomain) {
      // redirect to cognito to log out there, too
      const redirectUrl = getLogoutRedirectUrl()
      window.location = `${cognitoDomain}/logout?client_id=${cognitoClientId}&logout_uri=${redirectUrl}`
    }
  }
}
Callback for the Cognito User Pool's logout just to make sure we clean up everything.