private setAdminConfig()

in authui-container/src/admin-ui.ts [368:387]


  private setAdminConfig(newConfig: UiConfig): Promise<void> {
    return this.sendAuthenticatedRequest(SET_ADMIN_CONFIG_PARAMS, newConfig)
      .then(() => {
        this.showToastMessage('success', MSG_CONFIGURATION_SAVED);
      })
      .catch((error) => {
        const resp = error.response;
        const errorData = resp.data;
        // Seems like the error is being constructed as Invalid Credentials:
        // {"error":{"code":500,"status":"UNKNOWN","message":"Invalid Credentials"}}
        if (errorData && errorData.error && errorData.error.message &&
            errorData.error.message.match(/invalid\scredentials/i)) {
          // Show re-auth button.
          this.reauthElement.style.display = 'inline-block';
          this.showToastMessage('error', MSG_INVALID_CREDENTIALS);
        } else {
          this.showToastMessage('error', errorData.error.message);
        }
      });
  }