intelica-library-ui 0.1.122 → 0.1.124

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.
@@ -234,13 +234,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
234
234
  }]
235
235
  }] });
236
236
 
237
- const configService = inject(ConfigService);
238
- const domain = window.location.hostname
239
- .split(".")
240
- .slice(configService.environment?.environment == "main" ? -2 : -3)
241
- .join(".");
242
- const secure = !domain.includes("localhost");
243
- const CookieAttributesGeneral = { domain: domain, path: "/", secure: secure };
237
+ const Domain = window.location.hostname.split(".").slice(-2).join(".");
238
+ const Secure = !Domain.includes("localhost");
239
+ const CookieAttributesGeneral = { domain: Domain, path: "/", secure: Secure };
244
240
 
245
241
  const Color = {
246
242
  mastercard: "#ff7f00",
@@ -428,10 +424,20 @@ const ErrorInterceptor = (req, next) => {
428
424
  }
429
425
  };
430
426
 
427
+ function GetCookieAttributes(environment) {
428
+ const domain = window.location.hostname
429
+ .split(".")
430
+ .slice(environment == "main" ? -2 : -3)
431
+ .join(".");
432
+ const secure = !domain.includes("localhost");
433
+ return { domain: domain, path: "/", secure: secure };
434
+ }
435
+
431
436
  const RefreshTokenInterceptor = (req, next) => {
432
437
  const configService = inject(ConfigService);
433
438
  const httpClient = inject(HttpClient);
434
439
  const commonFeatureFlagService = inject(GlobalFeatureFlagService);
440
+ const cookieAttributesGeneral = GetCookieAttributes(configService.environment?.environment ?? "");
435
441
  let _request = req.clone();
436
442
  let authenticationLocation = `${configService.environment?.authenticationWeb}?callback=${window.location.href}&clientID=${configService.environment?.clientID}`;
437
443
  let path = `${configService.environment?.authenticationPath ?? ""}/Authenticate/ValidateToken`;
@@ -450,20 +456,20 @@ const RefreshTokenInterceptor = (req, next) => {
450
456
  if (!req.url.includes("ValidateToken") && !req.url.includes("environment.json") && !req.url.includes("GetAuthenticationFromCache"))
451
457
  return from(httpClient.post(path, validateTokenQuery)).pipe(switchMap((response) => {
452
458
  if (response.expired) {
453
- Cookies.remove("token", CookieAttributesGeneral);
454
- Cookies.remove("refreshToken", CookieAttributesGeneral);
455
- Cookies.remove("data", CookieAttributesGeneral);
456
- Cookies.remove("businessUserClientGroupID", CookieAttributesGeneral);
457
- Cookies.remove("defaultClientID", CookieAttributesGeneral);
458
- Cookies.remove("defaultClientGroupID", CookieAttributesGeneral);
459
- Cookies.remove(authenticationClientID, CookieAttributesGeneral);
459
+ Cookies.remove("token", cookieAttributesGeneral);
460
+ Cookies.remove("refreshToken", cookieAttributesGeneral);
461
+ Cookies.remove("data", cookieAttributesGeneral);
462
+ Cookies.remove("businessUserClientGroupID", cookieAttributesGeneral);
463
+ Cookies.remove("defaultClientID", cookieAttributesGeneral);
464
+ Cookies.remove("defaultClientGroupID", cookieAttributesGeneral);
465
+ Cookies.remove(authenticationClientID, cookieAttributesGeneral);
460
466
  window.location.href = authenticationLocation;
461
467
  return next(_request);
462
468
  }
463
469
  if (response.unauthorized)
464
470
  window.location.href = window.location.origin;
465
471
  if (response.newToken != "")
466
- setCookie("token", response.newToken, CookieAttributesGeneral);
472
+ setCookie("token", response.newToken, cookieAttributesGeneral);
467
473
  return next(_request);
468
474
  }));
469
475
  else
@@ -6454,5 +6460,5 @@ const IntelicaTheme = definePreset(Aura, {
6454
6460
  * Generated bundle index. Do not edit.
6455
6461
  */
6456
6462
 
6457
- export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DataDirective, DynamicInputValidation, EchartComponent, EchartService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FormatAmountPipe, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, RowResumenComponent, SearchComponent, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TemplateMenuComponent, TermGuard, TermPipe, TermService, TruncatePipe, decryptData, encryptData, getColor };
6463
+ export { ActionDirective, ActionsMenuComponent, ButtonSplitComponent, Color, ColumnComponent, ColumnGroupComponent, CompareByField, ConfigService, CookieAttributesGeneral, DataDirective, DynamicInputValidation, EchartComponent, EchartService, EmailInputValidation, ErrorInterceptor, FeatureFlagService, FormatAmountPipe, GetCookieAttributes, GlobalFeatureFlagService, GlobalTermService, HtmlToExcelService, InitializeConfigService, InputValidation, IntelicaTheme, ItemSplitDirective, LanguageService, ModalDialogComponent, MultiSelectComponent, OrderConstants, PaginatorComponent, Patterns, PopoverComponent, ProfileService, RecordPerPageComponent, RefreshTokenInterceptor, RouteGuard, RowResumenComponent, SearchComponent, SharedService, SkeletonChartComponent, SkeletonComponent, SkeletonService, SkeletonTableComponent, SortingComponent, SpinnerComponent, SpinnerService, SweetAlertService, TableComponent, TemplateMenuComponent, TermGuard, TermPipe, TermService, TruncatePipe, decryptData, encryptData, getColor };
6458
6464
  //# sourceMappingURL=intelica-library-ui.mjs.map