@indigina/kendo 2.0.10 → 2.0.12

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.
@@ -1,7 +1,7 @@
1
1
  import * as i1$3 from '@angular/common';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
- import { Input, Directive, Component, NgModule, EventEmitter, Output, ChangeDetectionStrategy, HostListener, Injectable, ViewChildren, ViewChild, InjectionToken, Inject, provideAppInitializer, inject } from '@angular/core';
4
+ import { Input, Directive, Component, NgModule, EventEmitter, Output, ChangeDetectionStrategy, HostListener, Injectable, ViewChildren, ViewChild, InjectionToken, Inject, inject, provideAppInitializer } from '@angular/core';
5
5
  import * as i1 from '@angular/forms';
6
6
  import { UntypedFormControl, Validators, FormGroupDirective, ControlContainer, ReactiveFormsModule, FormsModule, UntypedFormGroup } from '@angular/forms';
7
7
  import * as i2 from '@ngx-translate/core';
@@ -15,7 +15,7 @@ import * as i2$1 from '@progress/kendo-angular-inputs';
15
15
  import { InputsModule } from '@progress/kendo-angular-inputs';
16
16
  import * as i3$1 from '@progress/kendo-angular-label';
17
17
  import { LabelModule } from '@progress/kendo-angular-label';
18
- import { BehaviorSubject, Subject, of, throwError, from, tap as tap$1, map as map$1, takeUntil } from 'rxjs';
18
+ import { BehaviorSubject, Subject, of, throwError, from, tap as tap$1, map as map$1, takeUntil, switchMap } from 'rxjs';
19
19
  import { map, mergeMap, debounceTime, catchError, tap, filter, take, finalize } from 'rxjs/operators';
20
20
  import { toODataString, distinct, filterBy } from '@progress/kendo-data-query';
21
21
  import * as i1$1 from 'ngx-toastr';
@@ -28,7 +28,7 @@ import { ClipboardModule } from 'ngx-clipboard';
28
28
  import { TreeViewModule } from '@progress/kendo-angular-treeview';
29
29
  import { InteractionRequiredAuthError, BrowserCacheLocation, PublicClientApplication } from '@azure/msal-browser';
30
30
  import * as i1$5 from '@azure/msal-angular';
31
- import { MsalModule, MsalService } from '@azure/msal-angular';
31
+ import { MsalService, MsalModule } from '@azure/msal-angular';
32
32
  import * as signalR from '@microsoft/signalr';
33
33
  import * as i3$2 from '@progress/kendo-angular-popup';
34
34
  import { PopupModule } from '@progress/kendo-angular-popup';
@@ -4132,34 +4132,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
4132
4132
  }]
4133
4133
  }] });
4134
4134
 
4135
- const AuthorizationHeader = 'Authorization';
4136
4135
  class AuthHeadersInterceptor {
4137
- constructor(settingsService) {
4138
- this.settingsService = settingsService;
4136
+ constructor() {
4137
+ this.msalService = inject(MsalService);
4139
4138
  }
4140
- intercept(request, next) {
4141
- if (!request.headers.keys().find((x) => x === AuthorizationHeader)) {
4142
- const token = this.settingsService.getToken();
4143
- if (token) {
4144
- const modified = request.clone({
4145
- setHeaders: {
4146
- Authorization: `Bearer ${token}`,
4147
- },
4148
- });
4149
- return next.handle(modified);
4150
- }
4151
- else {
4152
- return next.handle(request);
4153
- }
4154
- }
4155
- return next.handle(request);
4139
+ intercept(req, next) {
4140
+ return this.msalService.acquireTokenSilent({ scopes: [] }).pipe(switchMap(result => next.handle(this.addAuthHeader(req, result.idToken))));
4141
+ }
4142
+ addAuthHeader(req, token) {
4143
+ return req.clone({
4144
+ setHeaders: {
4145
+ Authorization: `Bearer ${token}`,
4146
+ },
4147
+ });
4156
4148
  }
4157
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AuthHeadersInterceptor, deps: [{ token: SettingsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4149
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AuthHeadersInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4158
4150
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AuthHeadersInterceptor }); }
4159
4151
  }
4160
4152
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AuthHeadersInterceptor, decorators: [{
4161
4153
  type: Injectable
4162
- }], ctorParameters: () => [{ type: SettingsService }] });
4154
+ }] });
4163
4155
 
4164
4156
  let defaultConfig = {
4165
4157
  langs: {