ngx-sp-auth 3.2.8 → 3.2.9

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.
@@ -104,13 +104,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
104
104
  }]
105
105
  }] });
106
106
 
107
- var InfraInAuthTypeId;
108
- (function (InfraInAuthTypeId) {
109
- InfraInAuthTypeId[InfraInAuthTypeId["Local"] = 1] = "Local";
110
- InfraInAuthTypeId[InfraInAuthTypeId["Azure"] = 2] = "Azure";
111
- InfraInAuthTypeId[InfraInAuthTypeId["LDAP"] = 3] = "LDAP";
112
- })(InfraInAuthTypeId || (InfraInAuthTypeId = {}));
113
-
114
107
  var InfraIn2FaTypeId;
115
108
  (function (InfraIn2FaTypeId) {
116
109
  InfraIn2FaTypeId[InfraIn2FaTypeId["Email"] = 1] = "Email";
@@ -118,6 +111,13 @@ var InfraIn2FaTypeId;
118
111
  InfraIn2FaTypeId[InfraIn2FaTypeId["Microsoft"] = 3] = "Microsoft";
119
112
  })(InfraIn2FaTypeId || (InfraIn2FaTypeId = {}));
120
113
 
114
+ var InfraInAuthTypeId;
115
+ (function (InfraInAuthTypeId) {
116
+ InfraInAuthTypeId[InfraInAuthTypeId["Local"] = 1] = "Local";
117
+ InfraInAuthTypeId[InfraInAuthTypeId["Azure"] = 2] = "Azure";
118
+ InfraInAuthTypeId[InfraInAuthTypeId["LDAP"] = 3] = "LDAP";
119
+ })(InfraInAuthTypeId || (InfraInAuthTypeId = {}));
120
+
121
121
  // Token para o LibCustomEnvironmentService
122
122
  const LIB_CUSTOM_ENVIRONMENT_SERVICE = new InjectionToken('LibCustomEnvironmentService');
123
123
  // Token para o LibCustomStorageService
@@ -763,7 +763,9 @@ class ProjectUtilservice {
763
763
  showHTTPErrorOS(error) {
764
764
  if (error.error instanceof ErrorEvent) {
765
765
  // Erro ocorreu no lado do cliente
766
- this.messageService.showAlertDanger(Utils.getHttpErrorMessage(error));
766
+ this.router.navigate(["/auth/login"]).then(e => {
767
+ this.messageService.showAlertDanger(Utils.getHttpErrorMessage(error));
768
+ });
767
769
  }
768
770
  else {
769
771
  // Erro ocorreu no lado do servidor
@@ -779,11 +781,15 @@ class ProjectUtilservice {
779
781
  });
780
782
  }
781
783
  else {
782
- this.messageService.showAlertDanger(Utils.getHttpErrorMessage(error));
784
+ this.router.navigate(["/auth/login"]).then(e => {
785
+ this.messageService.showAlertDanger(Utils.getHttpErrorMessage(error));
786
+ });
783
787
  }
784
788
  }
785
789
  else {
786
- this.messageService.showAlertDanger(Utils.getHttpErrorMessage(error));
790
+ this.router.navigate(["/auth/login"]).then(e => {
791
+ this.messageService.showAlertDanger(Utils.getHttpErrorMessage(error));
792
+ });
787
793
  }
788
794
  }
789
795
  }
@@ -1130,6 +1136,7 @@ class AuthService {
1130
1136
  }
1131
1137
  }));
1132
1138
  }
1139
+ /** Realiza o logout do sistema, removendo tokens do localStorage e limpando cache */
1133
1140
  logout() {
1134
1141
  this._authStorageService.logout();
1135
1142
  localStorage.removeItem('configsServerUser');
@@ -2130,6 +2137,7 @@ class LoginOSComponent {
2130
2137
  this.timer = 3;
2131
2138
  }
2132
2139
  ngOnInit() {
2140
+ this._storageService.logout();
2133
2141
  this.getParams();
2134
2142
  this.logOn();
2135
2143
  }
@@ -2143,7 +2151,6 @@ class LoginOSComponent {
2143
2151
  const currUsuario = this._storageService.user ?? undefined;
2144
2152
  this._authService.getAuthentication(this._loginOSModel.dominio).subscribe({
2145
2153
  next: () => {
2146
- throw new Error("Erro de teste");
2147
2154
  if (currDominio === this._loginOSModel.dominio && currUsuario === this._loginOSModel.usuario) {
2148
2155
  status = "keep";
2149
2156
  this.redirect();