ngx-sp-auth 4.22.7 → 4.22.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,4 +1,4 @@
1
- import { Router, RouterStateSnapshot, ActivatedRouteSnapshot, Route, UrlTree } from '@angular/router';
1
+ import { ActivatedRouteSnapshot, Route, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
2
2
  import { Observable } from 'rxjs';
3
3
  import { AuthStorageService } from '../storage/auth-storage.service';
4
4
  import * as i0 from "@angular/core";
@@ -1,7 +1,7 @@
1
- import { Router, RouterStateSnapshot, ActivatedRouteSnapshot, UrlTree } from '@angular/router';
1
+ import { ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
2
2
  import { Observable } from 'rxjs';
3
- import { AuthStorageService } from '../storage/auth-storage.service';
4
3
  import { AuthService } from '../auth.service';
4
+ import { AuthStorageService } from '../storage/auth-storage.service';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class ExternaLoginlGuard {
7
7
  private router;
@@ -2,7 +2,6 @@ export interface Token {
2
2
  domain: string;
3
3
  user: string;
4
4
  tenantId: number;
5
- token: string;
6
5
  infraUsuarioId: string;
7
6
  userName: string;
8
7
  }
@@ -1,7 +1,7 @@
1
1
  import { HttpBackend } from '@angular/common/http';
2
- import { BehaviorSubject } from 'rxjs';
3
- import { Payload } from './../models/payload';
2
+ import { BehaviorSubject, Observable } from 'rxjs';
4
3
  import { Router } from '@angular/router';
4
+ import { RetError } from 'ngx-sp-infra';
5
5
  import { LibCustomEnvironmentService } from '../custom/lib-custom-environment.service';
6
6
  import { LibCustomLoginService } from '../custom/lib-custom-login.service';
7
7
  import { LibCustomStorageService } from '../custom/lib-custom-storage.service';
@@ -16,11 +16,13 @@ export declare class AuthStorageService {
16
16
  private _router;
17
17
  private readonly _BASE_URL;
18
18
  private readonly _LOGOUT_BASE_URL;
19
+ private readonly _BASE_VERIFICATION_URL;
19
20
  private readonly _HTTP_HEADERS;
20
21
  private readonly __local_key;
21
22
  private __isSaving;
22
23
  /** Se ainda estamos com uma função rodando para verificar o login do usuário */
23
24
  private __isCheckingAuth;
25
+ private __authenticationCheck$;
24
26
  private _httpClient;
25
27
  constructor(_httpBackend: HttpBackend, _customStorageService: LibCustomStorageService, _indexedDBService: IndexedDBService, _customEnvironmentService: LibCustomEnvironmentService, _customLoginService: LibCustomLoginService, _router: Router);
26
28
  isLoggedInSub: BehaviorSubject<boolean>;
@@ -51,12 +53,6 @@ export declare class AuthStorageService {
51
53
  private __userName;
52
54
  get userName(): string;
53
55
  set userName(value: string);
54
- private __tokenPayload;
55
- get tokenPayload(): Payload;
56
- set tokenPayload(value: Payload);
57
- private __authToken;
58
- get authToken(): string;
59
- set authToken(value: string);
60
56
  /** Domínio */
61
57
  private __dominio;
62
58
  get dominio(): string;
@@ -94,8 +90,9 @@ export declare class AuthStorageService {
94
90
  toJson(): string;
95
91
  /** Inicia a verificação do login. */
96
92
  startLoginCheck(): void;
93
+ checkAuthentication(): Observable<boolean>;
94
+ verifyToken(): Observable<RetError>;
97
95
  /** Verifica a cada diferença de tempo entre a data atual e a data do token. */
98
- reCheckLogin(renew: boolean): Promise<void>;
99
96
  /**
100
97
  * Realiza o logout do sistema, consumindo o endpoint de logout para remover os cookies e limpando as informações de autenticação armazenadas no localStorage.
101
98
  * @returns Promise<boolean> indicando navegação para a tela de login após o logout.
@@ -106,7 +103,6 @@ export declare class AuthStorageService {
106
103
  /**
107
104
  * Renova o Token quando este estiver vencido.
108
105
  */
109
- renewToken(): Promise<void>;
110
106
  private onLogout;
111
107
  private isPrePortal;
112
108
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthStorageService, never>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-sp-auth",
3
- "version": "4.22.7",
3
+ "version": "4.22.13",
4
4
  "description": "Biblioteca de utilitários de autenticação.",
5
5
  "author": "P&D",
6
6
  "keywords": [
@@ -1,9 +0,0 @@
1
- export interface Payload {
2
- userId: string;
3
- userName: string;
4
- sub: string;
5
- iss: string;
6
- aud: string;
7
- iat: number;
8
- exp: number;
9
- }