ngx-sp-auth 4.23.4 → 4.23.6

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.
@@ -8,16 +8,17 @@ import { LogLevel, PublicClientApplication, InteractionType } from '@azure/msal-
8
8
  import { take as take$1, tap as tap$1, map as map$1, switchMap as switchMap$1 } from 'rxjs/operators';
9
9
  import * as i1$1 from '@angular/router';
10
10
  import { RouterLink, NavigationEnd, RouterOutlet } from '@angular/router';
11
- import { BehaviorSubject, map, catchError, of, finalize, shareReplay, take, tap, firstValueFrom, Subject, Subscription, debounceTime, distinctUntilChanged, filter, switchMap, timer, lastValueFrom, from, throwError } from 'rxjs';
12
11
  import * as i3 from 'ngx-sp-infra';
13
12
  import { IpServiceService, Utils, SearchInputComponent, InfraModule, FormUtils, Usuario, RetPasswordPolicy, RetCheckPassword, CheckPasswordRecord, PasswordPolicyComponent, LibIconsComponent, ContentContainerComponent } from 'ngx-sp-infra';
13
+ import * as i10 from 'ngx-toastr';
14
+ import { ToastrService } from 'ngx-toastr';
15
+ import { BehaviorSubject, map, catchError, of, finalize, shareReplay, defer, take, tap, firstValueFrom, Subject, Subscription, debounceTime, distinctUntilChanged, filter, switchMap, timer, lastValueFrom, from, throwError } from 'rxjs';
14
16
  import { openDB, deleteDB } from 'idb';
15
17
  import * as i17 from '@angular/common';
16
18
  import { NgIf, CommonModule, NgClass } from '@angular/common';
17
19
  import * as i7 from '@angular/forms';
18
20
  import { Validators, ReactiveFormsModule, FormGroup, FormControl, FormsModule } from '@angular/forms';
19
21
  import * as i8 from '@angular/platform-browser';
20
- import * as i10 from 'ngx-toastr';
21
22
  import * as i11 from '@angular/cdk/layout';
22
23
  import { Breakpoints } from '@angular/cdk/layout';
23
24
  import * as i15 from 'ngx-bootstrap/popover';
@@ -522,6 +523,7 @@ class AuthStorageService {
522
523
  this._customEnvironmentService = _customEnvironmentService;
523
524
  this._router = _router;
524
525
  this._ipService = inject(IpServiceService);
526
+ this._toastr = inject(ToastrService);
525
527
  this._BASE_URL = ''; // SpInfra2LoginWS
526
528
  this._LOGOUT_BASE_URL = ''; // SpInfra2LoginWS
527
529
  this._BASE_VERIFICATION_URL = ''; // SpInfra2LoginWS
@@ -829,15 +831,20 @@ class AuthStorageService {
829
831
  verifyToken() {
830
832
  const url = `${this._BASE_VERIFICATION_URL}`;
831
833
  const headers = this._HTTP_HEADERS;
832
- const params = new HttpParams()
833
- .set('ip', this.ip)
834
- .set('browser', this._ipService.getDataBrowserUser().browser);
835
- return this._httpClient.get(url, { params, 'headers': headers, withCredentials: true })
836
- .pipe(take(1), tap(res => {
837
- if (res.Error)
838
- this.isLoggedInSub.next(false);
839
- else
840
- this.isLoggedInSub.next(true);
834
+ return defer(() => {
835
+ this._toastr.info('Validando token do usuário.', 'Aguarde...', { timeOut: 3000, progressBar: true, progressAnimation: 'increasing', closeButton: true });
836
+ const params = new HttpParams()
837
+ .set('ip', this.ip)
838
+ .set('browser', this._ipService.getDataBrowserUser().browser);
839
+ return this._httpClient.get(url, { params, 'headers': headers, withCredentials: true })
840
+ .pipe(take(1), tap(res => {
841
+ if (res.Error)
842
+ this.isLoggedInSub.next(false);
843
+ else
844
+ this.isLoggedInSub.next(true);
845
+ }));
846
+ }).pipe(finalize(() => {
847
+ this._toastr.clear();
841
848
  }));
842
849
  }
843
850
  /** Verifica a cada diferença de tempo entre a data atual e a data do token. */