@annalib/anna-cognito-lib 2.2.19 → 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
  }] }]; } });
@@ -496,17 +507,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
496
507
  args: [CONFIG_SERVICE_TOKEN]
497
508
  }] }]; } });
498
509
 
499
- class LoginComponent {
510
+ class CognitoAndSSOLoginContainerComponent {
500
511
  constructor(consumingProjectSSOLoginService) {
501
512
  this.consumingProjectSSOLoginService = consumingProjectSSOLoginService;
502
513
  }
503
514
  ngOnInit() { }
504
515
  }
505
- LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LoginComponent, deps: [{ token: SSO_LOGIN_SERVICE_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
506
- LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: LoginComponent, selector: "anna-cognito-lib-login", ngImport: i0, template: "<anna-cognito-lib-anna-login *ngIf=\"!consumingProjectSSOLoginService?.isSsoIntegrated\"></anna-cognito-lib-anna-login>\r\n<anna-cognito-lib-sso-login *ngIf=\"consumingProjectSSOLoginService?.isSsoIntegrated\"></anna-cognito-lib-sso-login>", styles: [""], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SsoLoginComponent, selector: "anna-cognito-lib-sso-login" }, { kind: "component", type: AnnaLoginComponent, selector: "anna-cognito-lib-anna-login" }] });
507
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: LoginComponent, decorators: [{
516
+ CognitoAndSSOLoginContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CognitoAndSSOLoginContainerComponent, deps: [{ token: SSO_LOGIN_SERVICE_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
517
+ CognitoAndSSOLoginContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CognitoAndSSOLoginContainerComponent, selector: "anna-cognito-lib-cognito-and-sso-login-container", ngImport: i0, template: "<anna-cognito-lib-anna-login *ngIf=\"!consumingProjectSSOLoginService?.isSsoIntegrated\"></anna-cognito-lib-anna-login>\r\n<anna-cognito-lib-sso-login *ngIf=\"consumingProjectSSOLoginService?.isSsoIntegrated\"></anna-cognito-lib-sso-login>", styles: [""], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SsoLoginComponent, selector: "anna-cognito-lib-sso-login" }, { kind: "component", type: AnnaLoginComponent, selector: "anna-cognito-lib-anna-login" }] });
518
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CognitoAndSSOLoginContainerComponent, decorators: [{
508
519
  type: Component,
509
- args: [{ selector: "anna-cognito-lib-login", template: "<anna-cognito-lib-anna-login *ngIf=\"!consumingProjectSSOLoginService?.isSsoIntegrated\"></anna-cognito-lib-anna-login>\r\n<anna-cognito-lib-sso-login *ngIf=\"consumingProjectSSOLoginService?.isSsoIntegrated\"></anna-cognito-lib-sso-login>" }]
520
+ args: [{ selector: "anna-cognito-lib-cognito-and-sso-login-container", template: "<anna-cognito-lib-anna-login *ngIf=\"!consumingProjectSSOLoginService?.isSsoIntegrated\"></anna-cognito-lib-anna-login>\r\n<anna-cognito-lib-sso-login *ngIf=\"consumingProjectSSOLoginService?.isSsoIntegrated\"></anna-cognito-lib-sso-login>" }]
510
521
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
511
522
  type: Inject,
512
523
  args: [SSO_LOGIN_SERVICE_TOKEN]
@@ -825,7 +836,7 @@ class AnnaCognitoLibModule {
825
836
  constructor() { }
826
837
  }
827
838
  AnnaCognitoLibModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AnnaCognitoLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
828
- AnnaCognitoLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: AnnaCognitoLibModule, declarations: [LoginComponent,
839
+ AnnaCognitoLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: AnnaCognitoLibModule, declarations: [CognitoAndSSOLoginContainerComponent,
829
840
  SetNewPasswordComponent,
830
841
  PasswordMatchingComponent,
831
842
  ForgotPasswordComponent,
@@ -839,7 +850,7 @@ AnnaCognitoLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
839
850
  ReactiveFormsModule,
840
851
  RouterModule,
841
852
  CommonModule,
842
- NgOptimizedImage], exports: [LoginComponent,
853
+ NgOptimizedImage], exports: [CognitoAndSSOLoginContainerComponent,
843
854
  SsoLoginComponent,
844
855
  AnnaLoginComponent,
845
856
  SetNewPasswordComponent,
@@ -859,7 +870,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
859
870
  type: NgModule,
860
871
  args: [{
861
872
  declarations: [
862
- LoginComponent,
873
+ CognitoAndSSOLoginContainerComponent,
863
874
  SetNewPasswordComponent,
864
875
  PasswordMatchingComponent,
865
876
  ForgotPasswordComponent,
@@ -879,7 +890,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
879
890
  NgOptimizedImage
880
891
  ],
881
892
  exports: [
882
- LoginComponent,
893
+ CognitoAndSSOLoginContainerComponent,
883
894
  SsoLoginComponent,
884
895
  AnnaLoginComponent,
885
896
  SetNewPasswordComponent,
@@ -937,5 +948,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
937
948
  * Generated bundle index. Do not edit.
938
949
  */
939
950
 
940
- export { ACL_SERVICE_TOKEN, AUTH_SERVICE_TOKEN, AnnaCognitoLibModule, AnnaConfigService, AnnaLibAclService, AnnaLibAuthService, AnnaLoginComponent, AnnaSSOLoginService, CONFIG_SERVICE_TOKEN, ForgotPasswordComponent, LoginComponent, LoginConstant, PasswordMatchingComponent, PoweredByLogoTemplateComponent, SSO_LOGIN_SERVICE_TOKEN, SetNewPasswordComponent, SpinnerButtonDirective, SsoLoginComponent, SurewavesYearLogoComponent, VerifyAndSetNewPasswordComponent, VersionAndTermPolicyComponent };
951
+ export { ACL_SERVICE_TOKEN, AUTH_SERVICE_TOKEN, AnnaCognitoLibModule, AnnaConfigService, AnnaLibAclService, AnnaLibAuthService, AnnaLoginComponent, AnnaSSOLoginService, CONFIG_SERVICE_TOKEN, CognitoAndSSOLoginContainerComponent, ForgotPasswordComponent, LoginConstant, PasswordMatchingComponent, PoweredByLogoTemplateComponent, SSO_LOGIN_SERVICE_TOKEN, SetNewPasswordComponent, SpinnerButtonDirective, SsoLoginComponent, SurewavesYearLogoComponent, VerifyAndSetNewPasswordComponent, VersionAndTermPolicyComponent };
941
952
  //# sourceMappingURL=annalib-anna-cognito-lib.mjs.map