@indigina/kendo 2.0.11 → 2.0.13

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, map as map$1, from, tap as tap$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';
@@ -1792,18 +1792,15 @@ class AzureB2CProvider extends AuthProvider {
1792
1792
  const request = {
1793
1793
  scopes: ['openid', 'offline_access', 'profile'],
1794
1794
  };
1795
- return from(this.authService.instance
1796
- .acquireTokenSilent(request)
1797
- .then((authenticationResult) => {
1795
+ return this.authService.acquireTokenSilent(request).pipe(map$1((authenticationResult) => {
1798
1796
  const token = authenticationResult.idToken;
1799
1797
  this.settingsService.setToken(token);
1800
1798
  return token;
1801
- })
1802
- .catch(async (error) => {
1799
+ }), catchError((error) => {
1803
1800
  if (error instanceof InteractionRequiredAuthError) {
1804
- await this.authService.instance.acquireTokenRedirect(request);
1805
- return this.settingsService.getToken();
1801
+ this.authService.loginRedirect(request).subscribe();
1806
1802
  }
1803
+ return throwError(() => error);
1807
1804
  }));
1808
1805
  }
1809
1806
  }
@@ -4132,34 +4129,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
4132
4129
  }]
4133
4130
  }] });
4134
4131
 
4135
- const AuthorizationHeader = 'Authorization';
4136
4132
  class AuthHeadersInterceptor {
4137
- constructor(settingsService) {
4138
- this.settingsService = settingsService;
4133
+ constructor() {
4134
+ this.msalService = inject(MsalService);
4139
4135
  }
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);
4136
+ intercept(req, next) {
4137
+ return this.msalService.acquireTokenSilent({ scopes: [] }).pipe(switchMap(result => next.handle(this.addAuthHeader(req, result.idToken))));
4156
4138
  }
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 }); }
4139
+ addAuthHeader(req, token) {
4140
+ return req.clone({
4141
+ setHeaders: {
4142
+ Authorization: `Bearer ${token}`,
4143
+ },
4144
+ });
4145
+ }
4146
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AuthHeadersInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4158
4147
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AuthHeadersInterceptor }); }
4159
4148
  }
4160
4149
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AuthHeadersInterceptor, decorators: [{
4161
4150
  type: Injectable
4162
- }], ctorParameters: () => [{ type: SettingsService }] });
4151
+ }] });
4163
4152
 
4164
4153
  let defaultConfig = {
4165
4154
  langs: {