@eui/core 10.5.10 → 10.5.11-snapshot-1647511491329

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5263,27 +5263,41 @@
5263
5263
 
5264
5264
  var OpenIdConnectService = /** @class */ (function () {
5265
5265
  function OpenIdConnectService() {
5266
+ this.userDetails = new rxjs.Subject();
5266
5267
  if ((typeof ApiGateway) !== 'undefined') {
5267
5268
  var that_1 = this;
5268
5269
  ApiGateway.getUser(function (user) {
5269
- that_1.userDetails = {
5270
+ that_1.userDetails.next({
5270
5271
  domain: null,
5271
5272
  domainUsername: user.username,
5272
5273
  firstName: user.given_name,
5273
5274
  lastName: user.family_name,
5274
5275
  email: user.email,
5275
5276
  departmentNumber: user['https://ecas.ec.europa.eu/claims/department_number'],
5276
- };
5277
+ });
5278
+ that_1.userDetails.complete();
5279
+ });
5280
+ }
5281
+ else if ((typeof OpenIdConnect) !== 'undefined') {
5282
+ var that_2 = this;
5283
+ OpenIdConnect.getIdToken(function () {
5284
+ var detailsString = sessionStorage.getItem(OpenIdConnect.SESSION_STORAGE_KEY_USER_DETAILS);
5285
+ if (detailsString) {
5286
+ that_2.userDetails.next(JSON.parse(detailsString));
5287
+ that_2.userDetails.complete();
5288
+ }
5289
+ else {
5290
+ that_2.userDetails.next(null);
5291
+ that_2.userDetails.complete();
5292
+ }
5277
5293
  });
5278
5294
  }
5295
+ else {
5296
+ this.userDetails.next(null);
5297
+ this.userDetails.complete();
5298
+ }
5279
5299
  }
5280
5300
  OpenIdConnectService.prototype.getUserDetails = function () {
5281
- if (!this.userDetails && ((typeof OpenIdConnect) !== 'undefined')) {
5282
- var detailsString = sessionStorage.getItem(OpenIdConnect.SESSION_STORAGE_KEY_USER_DETAILS);
5283
- if (detailsString) {
5284
- this.userDetails = JSON.parse(detailsString);
5285
- }
5286
- }
5287
5301
  return this.userDetails;
5288
5302
  };
5289
5303
  return OpenIdConnectService;
@@ -5305,7 +5319,7 @@
5305
5319
  return _super !== null && _super.apply(this, arguments) || this;
5306
5320
  }
5307
5321
  OpenIdConnectServiceMock.prototype.getUserDetails = function () {
5308
- return null;
5322
+ return rxjs.of(null);
5309
5323
  };
5310
5324
  return OpenIdConnectServiceMock;
5311
5325
  }(OpenIdConnectService));