ngx-sp-auth 4.23.2 → 4.23.3
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.
package/fesm2022/ngx-sp-auth.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { importProvidersFrom, NgModule, InjectionToken, Inject, Injectable, ViewContainerRef, ViewChild, Component, EventEmitter, Output, Input, TemplateRef, ContentChild
|
|
2
|
+
import { importProvidersFrom, NgModule, InjectionToken, Inject, Injectable, inject, ViewContainerRef, ViewChild, Component, EventEmitter, Output, Input, TemplateRef, ContentChild } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common/http';
|
|
4
4
|
import { HTTP_INTERCEPTORS, HttpHeaders, HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
|
|
5
5
|
import * as i1$2 from '@azure/msal-angular';
|
|
@@ -9,9 +9,9 @@ import { take as take$1, tap as tap$1, map as map$1, switchMap as switchMap$1 }
|
|
|
9
9
|
import * as i1$1 from '@angular/router';
|
|
10
10
|
import { RouterLink, NavigationEnd, RouterOutlet } from '@angular/router';
|
|
11
11
|
import { BehaviorSubject, map, catchError, of, finalize, shareReplay, take, tap, firstValueFrom, Subject, Subscription, debounceTime, distinctUntilChanged, filter, switchMap, timer, lastValueFrom, from, throwError } from 'rxjs';
|
|
12
|
-
import { openDB, deleteDB } from 'idb';
|
|
13
12
|
import * as i3 from 'ngx-sp-infra';
|
|
14
|
-
import { Utils, SearchInputComponent, InfraModule, FormUtils, Usuario, RetPasswordPolicy, RetCheckPassword, CheckPasswordRecord, PasswordPolicyComponent, LibIconsComponent, ContentContainerComponent } from 'ngx-sp-infra';
|
|
13
|
+
import { IpServiceService, Utils, SearchInputComponent, InfraModule, FormUtils, Usuario, RetPasswordPolicy, RetCheckPassword, CheckPasswordRecord, PasswordPolicyComponent, LibIconsComponent, ContentContainerComponent } from 'ngx-sp-infra';
|
|
14
|
+
import { openDB, deleteDB } from 'idb';
|
|
15
15
|
import * as i17 from '@angular/common';
|
|
16
16
|
import { NgIf, CommonModule, NgClass } from '@angular/common';
|
|
17
17
|
import * as i7 from '@angular/forms';
|
|
@@ -521,6 +521,7 @@ class AuthStorageService {
|
|
|
521
521
|
this._indexedDBService = _indexedDBService;
|
|
522
522
|
this._customEnvironmentService = _customEnvironmentService;
|
|
523
523
|
this._router = _router;
|
|
524
|
+
this._ipService = inject(IpServiceService);
|
|
524
525
|
this._BASE_URL = ''; // SpInfra2LoginWS
|
|
525
526
|
this._LOGOUT_BASE_URL = ''; // SpInfra2LoginWS
|
|
526
527
|
this._BASE_VERIFICATION_URL = ''; // SpInfra2LoginWS
|
|
@@ -828,7 +829,10 @@ class AuthStorageService {
|
|
|
828
829
|
verifyToken() {
|
|
829
830
|
const url = `${this._BASE_VERIFICATION_URL}`;
|
|
830
831
|
const headers = this._HTTP_HEADERS;
|
|
831
|
-
|
|
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 })
|
|
832
836
|
.pipe(take(1), tap(res => {
|
|
833
837
|
if (res.Error)
|
|
834
838
|
this.isLoggedInSub.next(false);
|
|
@@ -4513,6 +4517,12 @@ class AuthGuard {
|
|
|
4513
4517
|
return true;
|
|
4514
4518
|
}));
|
|
4515
4519
|
}
|
|
4520
|
+
canMatch(_route, segments) {
|
|
4521
|
+
if (segments[0]?.path.toLowerCase() === 'auth') {
|
|
4522
|
+
return of(false);
|
|
4523
|
+
}
|
|
4524
|
+
return this.IsUserAuth();
|
|
4525
|
+
}
|
|
4516
4526
|
canActivate(_route, _state) {
|
|
4517
4527
|
return this.IsUserAuth();
|
|
4518
4528
|
}
|