@annalib/anna-cognito-lib 2.2.5 → 2.2.7

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,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, Injectable, Inject, Directive, Input, Component, EventEmitter, Output, NgModule } from '@angular/core';
3
3
  import { __awaiter } from 'tslib';
4
- import { fetchAuthSession, signIn, confirmSignIn, getCurrentUser, resetPassword, confirmResetPassword, signOut } from 'aws-amplify/auth';
4
+ import { getCurrentUser, fetchAuthSession, signIn, confirmSignIn, resetPassword, confirmResetPassword, signOut } from 'aws-amplify/auth';
5
5
  import * as i3 from '@angular/router';
6
6
  import { RouterModule } from '@angular/router';
7
7
  import * as i3$1 from '@angular/common/http';
@@ -101,7 +101,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
101
101
  } });
102
102
 
103
103
  class AnnaLibAuthService {
104
- // authIdFromOktaRedirectionUrl: string;
105
104
  constructor(router, aclService, httpClient, toastr, consumingProjectAuthService, consumingProjectConfigService) {
106
105
  this.router = router;
107
106
  this.aclService = aclService;
@@ -118,19 +117,28 @@ class AnnaLibAuthService {
118
117
  ngOnInit() { }
119
118
  isUserLoggedIn() {
120
119
  return __awaiter(this, void 0, void 0, function* () {
121
- const session = yield fetchAuthSession();
122
- return new Promise((resolve, reject) => {
123
- if (session === null || session === void 0 ? void 0 : session.tokens) {
124
- this.IdToken = session === null || session === void 0 ? void 0 : session.tokens.idToken.toString();
125
- this.getAllCognitoTokenAndGroups(session.tokens);
126
- resolve(true);
127
- }
128
- else {
129
- this.toastr.error(LoginConstant.sessionExpiredError);
130
- this.sessionTimeout();
120
+ try {
121
+ yield getCurrentUser();
122
+ return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
123
+ const session = yield fetchAuthSession();
124
+ if (session === null || session === void 0 ? void 0 : session.tokens) {
125
+ this.IdToken = session === null || session === void 0 ? void 0 : session.tokens.idToken.toString();
126
+ this.getAllCognitoTokenAndGroups(session.tokens);
127
+ resolve(true);
128
+ }
129
+ else {
130
+ this.toastr.error(LoginConstant.sessionExpiredError);
131
+ this.sessionTimeout();
132
+ resolve(false);
133
+ }
134
+ }));
135
+ }
136
+ catch (error) {
137
+ return new Promise((resolve) => {
138
+ clearInterval(this.accessTokenTimerId);
131
139
  resolve(false);
132
- }
133
- });
140
+ });
141
+ }
134
142
  });
135
143
  }
136
144
  sessionTimeout() {
@@ -138,17 +146,12 @@ class AnnaLibAuthService {
138
146
  clearInterval(this.accessTokenTimerId);
139
147
  this.router.navigate([LoginConstant.loginPageUrl]);
140
148
  }
141
- computeTokenExpiration(token) {
149
+ computeTokenExpiration(idToken) {
142
150
  let currentTime = Math.floor(Date.now() / 1000);
143
- let tokenTime = token.payload.exp;
151
+ let tokenTime = idToken.payload.exp;
144
152
  let expTime = (tokenTime - currentTime) * 1000;
145
153
  return expTime;
146
154
  }
147
- getCurrentSession() {
148
- return __awaiter(this, void 0, void 0, function* () {
149
- return yield fetchAuthSession();
150
- });
151
- }
152
155
  handleSignIn({ username, password }) {
153
156
  return __awaiter(this, void 0, void 0, function* () {
154
157
  try {
@@ -157,11 +160,12 @@ class AnnaLibAuthService {
157
160
  case "DONE":
158
161
  let session = yield fetchAuthSession();
159
162
  let newExpTime = this.computeTokenExpiration(session.tokens.idToken);
163
+ this.accessToken = session.tokens.accessToken.toString();
160
164
  localStorage.setItem("accessTokenExpiration", newExpTime.toString());
161
165
  this.refreshAccessToken();
162
166
  this.loginErrorMessage = null;
167
+ yield this.consumingProjectAuthService.onSuccessfulAuthenticatingUser(false);
163
168
  this.getAllCognitoTokenAndGroups(session.tokens);
164
- yield this.consumingProjectAuthService.onSuccessfulAuthenticatingUser(session.tokens.idToken.payload.sub);
165
169
  break;
166
170
  case "CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED":
167
171
  this.consumingProjectAuthService.isLoggingIn = false;
@@ -202,47 +206,46 @@ class AnnaLibAuthService {
202
206
  });
203
207
  }
204
208
  refreshAccessToken() {
205
- // // let currentUser = this.getCurrentUserDetails();
206
- // let accessTokenExpiration = localStorage.getItem("accessTokenExpiration");
207
- // let expTime = accessTokenExpiration ? parseInt(accessTokenExpiration) : 0;
208
- // this.accessTokenTimerId = setInterval(() => {
209
- // // let counter = 1000;
210
- // // let delayFunction = setTimeout(() => {
211
- // // currentUser && currentUser.getSession((error: any, token: CognitoUserSession | null) => {
212
- // let session = await fetchAuthSession();
213
- // if (session.tokens) {
214
- // this.getAllCognitoTokenAndGroups(session.tokens);
215
- // let newExpTime = this.computeTokenExpiration(this.IdToken);
216
- // if (newExpTime <= 0) {
217
- // newExpTime = 1000;
218
- // counter = 0;
219
- // if (delayFunction) {
220
- // clearInterval(delayFunction);
221
- // }
222
- // }
223
- // expTime = newExpTime;
224
- // localStorage.setItem("accessTokenExpiration", newExpTime.toString());
225
- // clearInterval(this.accessTokenTimerId);
226
- // this.refreshAccessToken();
227
- // } else if (error.code === "NotAuthorizedException") {
228
- // this.toastr.error(LoginConstant.sessionExpiredError);
229
- // this.sessionTimeout();
230
- // }
231
- // });
232
- // // }, counter);
233
- // // }, expTime);
209
+ let accessTokenExpiration = localStorage.getItem("accessTokenExpiration");
210
+ let expTime = accessTokenExpiration ? parseInt(accessTokenExpiration) : 0;
211
+ this.accessTokenTimerId = setInterval(() => {
212
+ let counter = 1000;
213
+ let delayFunction = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
214
+ try {
215
+ let session = yield fetchAuthSession();
216
+ let token = session.tokens;
217
+ if (token) {
218
+ this.getAllCognitoTokenAndGroups(token);
219
+ let newExpTime = this.computeTokenExpiration(this.IdToken);
220
+ if (newExpTime <= 0) {
221
+ newExpTime = 1000;
222
+ counter = 0;
223
+ if (delayFunction) {
224
+ clearInterval(delayFunction);
225
+ }
226
+ }
227
+ expTime = newExpTime;
228
+ localStorage.setItem("accessTokenExpiration", newExpTime.toString());
229
+ clearInterval(this.accessTokenTimerId);
230
+ this.refreshAccessToken();
231
+ }
232
+ else {
233
+ this.toastr.error(LoginConstant.sessionExpiredError);
234
+ this.sessionTimeout();
235
+ }
236
+ }
237
+ catch (error) {
238
+ this.toastr.error(LoginConstant.sessionExpiredError);
239
+ this.sessionTimeout();
240
+ }
241
+ }), counter);
242
+ }, expTime);
234
243
  }
235
244
  changePassword(newPassword) {
236
245
  return __awaiter(this, void 0, void 0, function* () {
237
246
  try {
238
- let session = yield fetchAuthSession();
239
- console.log(session);
240
- let oldPassword = this.userPassword;
241
247
  let inputParam = {
242
248
  challengeResponse: newPassword,
243
- options: {
244
- email: 'email@email'
245
- }
246
249
  };
247
250
  const data = yield confirmSignIn(inputParam);
248
251
  const { username } = yield getCurrentUser();
@@ -495,7 +498,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
495
498
  }] }];
496
499
  } });
497
500
 
498
- class DuoSsoLoginComponent {
501
+ class SsoLoginComponent {
499
502
  constructor(authService, consumingProjectConfigService) {
500
503
  this.authService = authService;
501
504
  this.consumingProjectConfigService = consumingProjectConfigService;
@@ -507,11 +510,11 @@ class DuoSsoLoginComponent {
507
510
  this.authService.signInWithDuo();
508
511
  }
509
512
  }
510
- DuoSsoLoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DuoSsoLoginComponent, deps: [{ token: AnnaLibAuthService }, { token: CONFIG_SERVICE_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
511
- DuoSsoLoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DuoSsoLoginComponent, selector: "anna-cognito-lib-duo-sso-login", ngImport: i0, template: "<div class=\"main\">\n <section *ngIf=\"constants.forgotPassword\">\n <header>\n <img [ngSrc]=\"consumingProjectConfigService.appGenericConfig.loginPageLogoImgUrl\" width=\"145\" height=\"50\"\n alt=\"Anna Logo\" priority />\n </header>\n <article>\n <p class=\"sub-title\">Login</p>\n <p>Sign in to your account with SSO</p>\n <button class=\"login-btn\" (click)=\"signInWithSSO()\">Login</button>\n <div class=\"dashed-line\"></div>\n <!-- <a tabindex=\"4\" class=\"login-link\" [routerLink]=\"constants.loginPageUrl\">Sign in with username</a> -->\n </article>\n <footer>\n <anna-cognito-lib-powered-by-logo-template>\n </anna-cognito-lib-powered-by-logo-template>\n </footer>\n </section>\n</div>\n\n<div class=\"page-footer\">\n <anna-cognito-lib-surewaves-year-logo></anna-cognito-lib-surewaves-year-logo>\n <anna-cognito-lib-version-and-term-policy></anna-cognito-lib-version-and-term-policy>\n</div>", styles: ["@keyframes show{0%{opacity:0}50%{opacity:.5}to{opacity:1}}html{overflow-y:scroll}.main{background-color:#fff;background-size:cover;font-family:Roboto;height:calc(100vh - 50px)}section{top:45%;left:50%;position:absolute;transform:translate(-50%,-50%);width:20.875rem;animation:show .5s 1;-moz-animation:show .5s 1}.container{width:100%;height:100%;overflow:auto}header{height:auto;width:100%;text-align:center}article{margin-top:.9375rem;margin-bottom:.9375rem;border:1px solid #979797;background-color:#f4f4f4;padding:2rem 1.375rem;border-radius:.375rem;box-shadow:0 .125rem .4375rem #0000001a}article .sub-title{color:#6e6e6e;font-family:Roboto;font-size:1.25rem;font-weight:700;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}article #heading{color:#212121;text-align:center;margin-bottom:1.5rem;font-family:Roboto;font-size:1.125rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}p{text-align:center;margin-bottom:1rem}#alert-div{padding:.25rem 0 0;margin-bottom:.75rem;border-radius:.25rem;border:solid 1px #f9b3ae;background-color:#fde4e3}#alert-div .material-icons{color:#f44336;font-size:1rem;margin-left:.5rem}#alert-div .mdi-info{color:#268bff;font-size:1rem}#alert-div p{margin:-1.5625rem 0 0 1.8rem;padding:.3125rem 0;color:#4a4a4a;font-family:Roboto;font-size:.75rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}#info-div{padding:6px 0;margin-bottom:.75rem;border-radius:.25rem;border:1px solid #268bff;background:#e3f0ff}#info-div .mdi-info{color:#268bff;font-size:1rem;margin-left:6px}#info-div p{margin:-1.5625rem 0 0 1.8rem;padding:.3125rem 0;color:#4a4a4a;font-family:Roboto;font-size:.75rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}footer{align-items:baseline;color:#6e6e6e;opacity:.9;display:flex;font-family:Ubuntu;font-size:1.25rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal;justify-content:center}footer span{font-size:1.5625rem;margin-left:.25rem}input[type=password],input[type=text],input[type=number]{width:100%;height:30px;padding:.75rem 1rem;border:1px solid #979797;margin-bottom:.625rem;border-radius:.375rem}.login-btn{width:100%;height:2.5rem;border:0;color:#fff;background-color:#268bff;border-radius:.375rem;font-size:1rem}.login-btn:hover{background-color:#4099ff;cursor:pointer}.login-btn:disabled{background-color:#ccc;color:#fff;cursor:not-allowed}.input-invalid{border:1px solid #fe3824!important}input[type=password].ng-dirty.ng-invalid,input[type=text].ng-dirty.ng-invalid{border:1px solid #fe3824}input[type=submit]:focus,input[type=password]:focus,input[type=text]:focus,input[type=checkbox]:focus,button:focus{outline:none}input::placeholder{color:#a4a4a4}:host ::ng-deep .verison-and-policy{color:#8bac2a}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "src", "srcset"] }, { kind: "component", type: VersionAndTermPolicyComponent, selector: "anna-cognito-lib-version-and-term-policy" }, { kind: "component", type: SurewavesYearLogoComponent, selector: "anna-cognito-lib-surewaves-year-logo" }, { kind: "component", type: PoweredByLogoTemplateComponent, selector: "anna-cognito-lib-powered-by-logo-template" }] });
512
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DuoSsoLoginComponent, decorators: [{
513
+ SsoLoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SsoLoginComponent, deps: [{ token: AnnaLibAuthService }, { token: CONFIG_SERVICE_TOKEN }], target: i0.ɵɵFactoryTarget.Component });
514
+ SsoLoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: SsoLoginComponent, selector: "anna-cognito-lib-sso-login", ngImport: i0, template: "<div class=\"main\">\n <section *ngIf=\"constants.forgotPassword\">\n <header>\n <img [ngSrc]=\"consumingProjectConfigService.appGenericConfig.loginPageLogoImgUrl\" width=\"145\" height=\"50\"\n alt=\"Anna Logo\" priority />\n </header>\n <article>\n <p class=\"sub-title\">Login</p>\n <p>Sign in to your account with SSO</p>\n <button class=\"login-btn\" (click)=\"signInWithSSO()\">Login</button>\n <div class=\"dashed-line\"></div>\n <!-- <a tabindex=\"4\" class=\"login-link\" [routerLink]=\"constants.loginPageUrl\">Sign in with username</a> -->\n </article>\n <footer>\n <anna-cognito-lib-powered-by-logo-template>\n </anna-cognito-lib-powered-by-logo-template>\n </footer>\n </section>\n</div>\n\n<div class=\"page-footer\">\n <anna-cognito-lib-surewaves-year-logo></anna-cognito-lib-surewaves-year-logo>\n <anna-cognito-lib-version-and-term-policy></anna-cognito-lib-version-and-term-policy>\n</div>", styles: ["@keyframes show{0%{opacity:0}50%{opacity:.5}to{opacity:1}}html{overflow-y:scroll}.main{background-color:#fff;background-size:cover;font-family:Roboto;height:calc(100vh - 50px)}section{top:45%;left:50%;position:absolute;transform:translate(-50%,-50%);width:20.875rem;animation:show .5s 1;-moz-animation:show .5s 1}.container{width:100%;height:100%;overflow:auto}header{height:auto;width:100%;text-align:center}article{margin-top:.9375rem;margin-bottom:.9375rem;border:1px solid #979797;background-color:#f4f4f4;padding:2rem 1.375rem;border-radius:.375rem;box-shadow:0 .125rem .4375rem #0000001a}article .sub-title{color:#6e6e6e;font-family:Roboto;font-size:1.25rem;font-weight:700;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}article #heading{color:#212121;text-align:center;margin-bottom:1.5rem;font-family:Roboto;font-size:1.125rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}p{text-align:center;margin-bottom:1rem}#alert-div{padding:.25rem 0 0;margin-bottom:.75rem;border-radius:.25rem;border:solid 1px #f9b3ae;background-color:#fde4e3}#alert-div .material-icons{color:#f44336;font-size:1rem;margin-left:.5rem}#alert-div .mdi-info{color:#268bff;font-size:1rem}#alert-div p{margin:-1.5625rem 0 0 1.8rem;padding:.3125rem 0;color:#4a4a4a;font-family:Roboto;font-size:.75rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}#info-div{padding:6px 0;margin-bottom:.75rem;border-radius:.25rem;border:1px solid #268bff;background:#e3f0ff}#info-div .mdi-info{color:#268bff;font-size:1rem;margin-left:6px}#info-div p{margin:-1.5625rem 0 0 1.8rem;padding:.3125rem 0;color:#4a4a4a;font-family:Roboto;font-size:.75rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}footer{align-items:baseline;color:#6e6e6e;opacity:.9;display:flex;font-family:Ubuntu;font-size:1.25rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal;justify-content:center}footer span{font-size:1.5625rem;margin-left:.25rem}input[type=password],input[type=text],input[type=number]{width:100%;height:30px;padding:.75rem 1rem;border:1px solid #979797;margin-bottom:.625rem;border-radius:.375rem}.login-btn{width:100%;height:2.5rem;border:0;color:#fff;background-color:#268bff;border-radius:.375rem;font-size:1rem}.login-btn:hover{background-color:#4099ff;cursor:pointer}.login-btn:disabled{background-color:#ccc;color:#fff;cursor:not-allowed}.input-invalid{border:1px solid #fe3824!important}input[type=password].ng-dirty.ng-invalid,input[type=text].ng-dirty.ng-invalid{border:1px solid #fe3824}input[type=submit]:focus,input[type=password]:focus,input[type=text]:focus,input[type=checkbox]:focus,button:focus{outline:none}input::placeholder{color:#a4a4a4}:host ::ng-deep .verison-and-policy{color:#8bac2a}\n"], dependencies: [{ kind: "directive", type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "src", "srcset"] }, { kind: "component", type: VersionAndTermPolicyComponent, selector: "anna-cognito-lib-version-and-term-policy" }, { kind: "component", type: SurewavesYearLogoComponent, selector: "anna-cognito-lib-surewaves-year-logo" }, { kind: "component", type: PoweredByLogoTemplateComponent, selector: "anna-cognito-lib-powered-by-logo-template" }] });
515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SsoLoginComponent, decorators: [{
513
516
  type: Component,
514
- args: [{ selector: 'anna-cognito-lib-duo-sso-login', template: "<div class=\"main\">\n <section *ngIf=\"constants.forgotPassword\">\n <header>\n <img [ngSrc]=\"consumingProjectConfigService.appGenericConfig.loginPageLogoImgUrl\" width=\"145\" height=\"50\"\n alt=\"Anna Logo\" priority />\n </header>\n <article>\n <p class=\"sub-title\">Login</p>\n <p>Sign in to your account with SSO</p>\n <button class=\"login-btn\" (click)=\"signInWithSSO()\">Login</button>\n <div class=\"dashed-line\"></div>\n <!-- <a tabindex=\"4\" class=\"login-link\" [routerLink]=\"constants.loginPageUrl\">Sign in with username</a> -->\n </article>\n <footer>\n <anna-cognito-lib-powered-by-logo-template>\n </anna-cognito-lib-powered-by-logo-template>\n </footer>\n </section>\n</div>\n\n<div class=\"page-footer\">\n <anna-cognito-lib-surewaves-year-logo></anna-cognito-lib-surewaves-year-logo>\n <anna-cognito-lib-version-and-term-policy></anna-cognito-lib-version-and-term-policy>\n</div>", styles: ["@keyframes show{0%{opacity:0}50%{opacity:.5}to{opacity:1}}html{overflow-y:scroll}.main{background-color:#fff;background-size:cover;font-family:Roboto;height:calc(100vh - 50px)}section{top:45%;left:50%;position:absolute;transform:translate(-50%,-50%);width:20.875rem;animation:show .5s 1;-moz-animation:show .5s 1}.container{width:100%;height:100%;overflow:auto}header{height:auto;width:100%;text-align:center}article{margin-top:.9375rem;margin-bottom:.9375rem;border:1px solid #979797;background-color:#f4f4f4;padding:2rem 1.375rem;border-radius:.375rem;box-shadow:0 .125rem .4375rem #0000001a}article .sub-title{color:#6e6e6e;font-family:Roboto;font-size:1.25rem;font-weight:700;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}article #heading{color:#212121;text-align:center;margin-bottom:1.5rem;font-family:Roboto;font-size:1.125rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}p{text-align:center;margin-bottom:1rem}#alert-div{padding:.25rem 0 0;margin-bottom:.75rem;border-radius:.25rem;border:solid 1px #f9b3ae;background-color:#fde4e3}#alert-div .material-icons{color:#f44336;font-size:1rem;margin-left:.5rem}#alert-div .mdi-info{color:#268bff;font-size:1rem}#alert-div p{margin:-1.5625rem 0 0 1.8rem;padding:.3125rem 0;color:#4a4a4a;font-family:Roboto;font-size:.75rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}#info-div{padding:6px 0;margin-bottom:.75rem;border-radius:.25rem;border:1px solid #268bff;background:#e3f0ff}#info-div .mdi-info{color:#268bff;font-size:1rem;margin-left:6px}#info-div p{margin:-1.5625rem 0 0 1.8rem;padding:.3125rem 0;color:#4a4a4a;font-family:Roboto;font-size:.75rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}footer{align-items:baseline;color:#6e6e6e;opacity:.9;display:flex;font-family:Ubuntu;font-size:1.25rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal;justify-content:center}footer span{font-size:1.5625rem;margin-left:.25rem}input[type=password],input[type=text],input[type=number]{width:100%;height:30px;padding:.75rem 1rem;border:1px solid #979797;margin-bottom:.625rem;border-radius:.375rem}.login-btn{width:100%;height:2.5rem;border:0;color:#fff;background-color:#268bff;border-radius:.375rem;font-size:1rem}.login-btn:hover{background-color:#4099ff;cursor:pointer}.login-btn:disabled{background-color:#ccc;color:#fff;cursor:not-allowed}.input-invalid{border:1px solid #fe3824!important}input[type=password].ng-dirty.ng-invalid,input[type=text].ng-dirty.ng-invalid{border:1px solid #fe3824}input[type=submit]:focus,input[type=password]:focus,input[type=text]:focus,input[type=checkbox]:focus,button:focus{outline:none}input::placeholder{color:#a4a4a4}:host ::ng-deep .verison-and-policy{color:#8bac2a}\n"] }]
517
+ args: [{ selector: 'anna-cognito-lib-sso-login', template: "<div class=\"main\">\n <section *ngIf=\"constants.forgotPassword\">\n <header>\n <img [ngSrc]=\"consumingProjectConfigService.appGenericConfig.loginPageLogoImgUrl\" width=\"145\" height=\"50\"\n alt=\"Anna Logo\" priority />\n </header>\n <article>\n <p class=\"sub-title\">Login</p>\n <p>Sign in to your account with SSO</p>\n <button class=\"login-btn\" (click)=\"signInWithSSO()\">Login</button>\n <div class=\"dashed-line\"></div>\n <!-- <a tabindex=\"4\" class=\"login-link\" [routerLink]=\"constants.loginPageUrl\">Sign in with username</a> -->\n </article>\n <footer>\n <anna-cognito-lib-powered-by-logo-template>\n </anna-cognito-lib-powered-by-logo-template>\n </footer>\n </section>\n</div>\n\n<div class=\"page-footer\">\n <anna-cognito-lib-surewaves-year-logo></anna-cognito-lib-surewaves-year-logo>\n <anna-cognito-lib-version-and-term-policy></anna-cognito-lib-version-and-term-policy>\n</div>", styles: ["@keyframes show{0%{opacity:0}50%{opacity:.5}to{opacity:1}}html{overflow-y:scroll}.main{background-color:#fff;background-size:cover;font-family:Roboto;height:calc(100vh - 50px)}section{top:45%;left:50%;position:absolute;transform:translate(-50%,-50%);width:20.875rem;animation:show .5s 1;-moz-animation:show .5s 1}.container{width:100%;height:100%;overflow:auto}header{height:auto;width:100%;text-align:center}article{margin-top:.9375rem;margin-bottom:.9375rem;border:1px solid #979797;background-color:#f4f4f4;padding:2rem 1.375rem;border-radius:.375rem;box-shadow:0 .125rem .4375rem #0000001a}article .sub-title{color:#6e6e6e;font-family:Roboto;font-size:1.25rem;font-weight:700;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}article #heading{color:#212121;text-align:center;margin-bottom:1.5rem;font-family:Roboto;font-size:1.125rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}p{text-align:center;margin-bottom:1rem}#alert-div{padding:.25rem 0 0;margin-bottom:.75rem;border-radius:.25rem;border:solid 1px #f9b3ae;background-color:#fde4e3}#alert-div .material-icons{color:#f44336;font-size:1rem;margin-left:.5rem}#alert-div .mdi-info{color:#268bff;font-size:1rem}#alert-div p{margin:-1.5625rem 0 0 1.8rem;padding:.3125rem 0;color:#4a4a4a;font-family:Roboto;font-size:.75rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}#info-div{padding:6px 0;margin-bottom:.75rem;border-radius:.25rem;border:1px solid #268bff;background:#e3f0ff}#info-div .mdi-info{color:#268bff;font-size:1rem;margin-left:6px}#info-div p{margin:-1.5625rem 0 0 1.8rem;padding:.3125rem 0;color:#4a4a4a;font-family:Roboto;font-size:.75rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal}footer{align-items:baseline;color:#6e6e6e;opacity:.9;display:flex;font-family:Ubuntu;font-size:1.25rem;font-weight:400;font-stretch:normal;font-style:normal;line-height:normal;letter-spacing:normal;justify-content:center}footer span{font-size:1.5625rem;margin-left:.25rem}input[type=password],input[type=text],input[type=number]{width:100%;height:30px;padding:.75rem 1rem;border:1px solid #979797;margin-bottom:.625rem;border-radius:.375rem}.login-btn{width:100%;height:2.5rem;border:0;color:#fff;background-color:#268bff;border-radius:.375rem;font-size:1rem}.login-btn:hover{background-color:#4099ff;cursor:pointer}.login-btn:disabled{background-color:#ccc;color:#fff;cursor:not-allowed}.input-invalid{border:1px solid #fe3824!important}input[type=password].ng-dirty.ng-invalid,input[type=text].ng-dirty.ng-invalid{border:1px solid #fe3824}input[type=submit]:focus,input[type=password]:focus,input[type=text]:focus,input[type=checkbox]:focus,button:focus{outline:none}input::placeholder{color:#a4a4a4}:host ::ng-deep .verison-and-policy{color:#8bac2a}\n"] }]
515
518
  }], ctorParameters: function () {
516
519
  return [{ type: AnnaLibAuthService }, { type: undefined, decorators: [{
517
520
  type: Inject,
@@ -844,12 +847,12 @@ AnnaCognitoLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
844
847
  VersionAndTermPolicyComponent,
845
848
  SurewavesYearLogoComponent,
846
849
  PoweredByLogoTemplateComponent,
847
- DuoSsoLoginComponent], imports: [FormsModule,
850
+ SsoLoginComponent], imports: [FormsModule,
848
851
  ReactiveFormsModule,
849
852
  RouterModule,
850
853
  CommonModule,
851
854
  NgOptimizedImage], exports: [LoginComponent,
852
- DuoSsoLoginComponent,
855
+ SsoLoginComponent,
853
856
  SetNewPasswordComponent,
854
857
  PasswordMatchingComponent,
855
858
  ForgotPasswordComponent,
@@ -876,7 +879,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
876
879
  VersionAndTermPolicyComponent,
877
880
  SurewavesYearLogoComponent,
878
881
  PoweredByLogoTemplateComponent,
879
- DuoSsoLoginComponent,
882
+ SsoLoginComponent,
880
883
  ],
881
884
  imports: [
882
885
  FormsModule,
@@ -887,7 +890,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
887
890
  ],
888
891
  exports: [
889
892
  LoginComponent,
890
- DuoSsoLoginComponent,
893
+ SsoLoginComponent,
891
894
  SetNewPasswordComponent,
892
895
  PasswordMatchingComponent,
893
896
  ForgotPasswordComponent,
@@ -928,5 +931,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
928
931
  * Generated bundle index. Do not edit.
929
932
  */
930
933
 
931
- export { ACL_SERVICE_TOKEN, AUTH_SERVICE_TOKEN, AnnaCognitoLibModule, AnnaConfigService, AnnaLibAclService, AnnaLibAuthService, CONFIG_SERVICE_TOKEN, DuoSsoLoginComponent, ForgotPasswordComponent, LoginComponent, LoginConstant, PasswordMatchingComponent, PoweredByLogoTemplateComponent, SetNewPasswordComponent, SpinnerButtonDirective, SurewavesYearLogoComponent, VerifyAndSetNewPasswordComponent, VersionAndTermPolicyComponent };
934
+ export { ACL_SERVICE_TOKEN, AUTH_SERVICE_TOKEN, AnnaCognitoLibModule, AnnaConfigService, AnnaLibAclService, AnnaLibAuthService, CONFIG_SERVICE_TOKEN, ForgotPasswordComponent, LoginComponent, LoginConstant, PasswordMatchingComponent, PoweredByLogoTemplateComponent, SetNewPasswordComponent, SpinnerButtonDirective, SsoLoginComponent, SurewavesYearLogoComponent, VerifyAndSetNewPasswordComponent, VersionAndTermPolicyComponent };
932
935
  //# sourceMappingURL=annalib-anna-cognito-lib.mjs.map