/*
 * Copyright (C) 2019 Robert Bosch GmbH Copyright (C) 2019 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

window.onload = function () {
  /* The parent window hosts the Angular application */
  const parent = window.opener || window.parent; // opener for popup, parent for iframe
  /* Send the id_token information to the oidc message handler */
  const urlWithAuthorizationCode = window.location.href;

  const eventAsPerDocs = new CustomEvent('oidc-silent-renew-message', {detail: urlWithAuthorizationCode});
  parent.dispatchEvent(eventAsPerDocs);
};
