@annalib/anna-cognito-lib 2.2.20 → 2.2.21

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.
@@ -103,11 +103,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
103
103
 
104
104
  // Angular import statements
105
105
  class AnnaLibAuthService {
106
- constructor(router, aclService, httpClient, toastr, consumingProjectAuthService) {
106
+ constructor(router, aclService, httpClient, toastr, consumingProjectSSOLoginService, consumingProjectAuthService) {
107
107
  this.router = router;
108
108
  this.aclService = aclService;
109
109
  this.httpClient = httpClient;
110
110
  this.toastr = toastr;
111
+ this.consumingProjectSSOLoginService = consumingProjectSSOLoginService;
111
112
  this.consumingProjectAuthService = consumingProjectAuthService;
112
113
  this.noOfAttempts = 0;
113
114
  this.sessionLocked = false;
@@ -143,7 +144,14 @@ class AnnaLibAuthService {
143
144
  sessionTimeout() {
144
145
  localStorage.clear();
145
146
  clearInterval(this.accessTokenTimerId);
146
- this.router.navigate([this.consumingProjectAuthService.defaultLoginPageUrl ? this.consumingProjectAuthService.defaultLoginPageUrl : LoginConstant.loginPageUrl]);
147
+ let afterLogoutRedirectTo;
148
+ if (this.consumingProjectSSOLoginService.isSsoIntegrated && !this.consumingProjectSSOLoginService.loggedInViaSso) {
149
+ afterLogoutRedirectTo = LoginConstant.coPilotloginPageUrl;
150
+ }
151
+ else {
152
+ afterLogoutRedirectTo = LoginConstant.loginPageUrl;
153
+ }
154
+ this.router.navigate([afterLogoutRedirectTo]);
147
155
  }
148
156
  computeTokenExpiration(idToken) {
149
157
  let currentTime = Math.floor(Date.now() / 1000);
@@ -346,7 +354,7 @@ class AnnaLibAuthService {
346
354
  }
347
355
  }
348
356
  }
349
- AnnaLibAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AnnaLibAuthService, deps: [{ token: i3.Router }, { token: AnnaLibAclService }, { token: i3$1.HttpClient }, { token: i4.ToastrService }, { token: AUTH_SERVICE_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
357
+ AnnaLibAuthService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AnnaLibAuthService, deps: [{ token: i3.Router }, { token: AnnaLibAclService }, { token: i3$1.HttpClient }, { token: i4.ToastrService }, { token: SSO_LOGIN_SERVICE_TOKEN }, { token: AUTH_SERVICE_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable });
350
358
  AnnaLibAuthService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AnnaLibAuthService, providedIn: "root" });
351
359
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AnnaLibAuthService, decorators: [{
352
360
  type: Injectable,
@@ -354,6 +362,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
354
362
  providedIn: "root",
355
363
  }]
356
364
  }], ctorParameters: function () { return [{ type: i3.Router }, { type: AnnaLibAclService }, { type: i3$1.HttpClient }, { type: i4.ToastrService }, { type: undefined, decorators: [{
365
+ type: Inject,
366
+ args: [SSO_LOGIN_SERVICE_TOKEN]
367
+ }] }, { type: undefined, decorators: [{
357
368
  type: Inject,
358
369
  args: [AUTH_SERVICE_TOKEN]
359
370
  }] }]; } });