@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.
@@ -5,7 +5,7 @@ import { Validators, FormBuilder, FormsModule, ReactiveFormsModule } from '@angu
5
5
  import * as i3$1 from '@angular/common/http';
6
6
  import * as i3 from '@angular/router';
7
7
  import { RouterModule } from '@angular/router';
8
- import { fetchAuthSession, signIn, confirmSignIn, getCurrentUser, resetPassword, confirmResetPassword, signOut } from 'aws-amplify/auth';
8
+ import { getCurrentUser, fetchAuthSession, signIn, confirmSignIn, resetPassword, confirmResetPassword, signOut } from 'aws-amplify/auth';
9
9
  import * as i4 from 'ngx-toastr';
10
10
  import * as i4$1 from '@angular/common';
11
11
  import { CommonModule, NgOptimizedImage } from '@angular/common';
@@ -99,7 +99,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
99
99
 
100
100
  // Angular import statements
101
101
  class AnnaLibAuthService {
102
- // authIdFromOktaRedirectionUrl: string;
103
102
  constructor(router, aclService, httpClient, toastr, consumingProjectAuthService, consumingProjectConfigService) {
104
103
  this.router = router;
105
104
  this.aclService = aclService;
@@ -115,34 +114,40 @@ class AnnaLibAuthService {
115
114
  }
116
115
  ngOnInit() { }
117
116
  async isUserLoggedIn() {
118
- const session = await fetchAuthSession();
119
- return new Promise((resolve, reject) => {
120
- if (session?.tokens) {
121
- this.IdToken = session?.tokens.idToken.toString();
122
- this.getAllCognitoTokenAndGroups(session.tokens);
123
- resolve(true);
124
- }
125
- else {
126
- this.toastr.error(LoginConstant.sessionExpiredError);
127
- this.sessionTimeout();
117
+ try {
118
+ await getCurrentUser();
119
+ return new Promise(async (resolve, reject) => {
120
+ const session = await fetchAuthSession();
121
+ if (session?.tokens) {
122
+ this.IdToken = session?.tokens.idToken.toString();
123
+ this.getAllCognitoTokenAndGroups(session.tokens);
124
+ resolve(true);
125
+ }
126
+ else {
127
+ this.toastr.error(LoginConstant.sessionExpiredError);
128
+ this.sessionTimeout();
129
+ resolve(false);
130
+ }
131
+ });
132
+ }
133
+ catch (error) {
134
+ return new Promise((resolve) => {
135
+ clearInterval(this.accessTokenTimerId);
128
136
  resolve(false);
129
- }
130
- });
137
+ });
138
+ }
131
139
  }
132
140
  sessionTimeout() {
133
141
  localStorage.clear();
134
142
  clearInterval(this.accessTokenTimerId);
135
143
  this.router.navigate([LoginConstant.loginPageUrl]);
136
144
  }
137
- computeTokenExpiration(token) {
145
+ computeTokenExpiration(idToken) {
138
146
  let currentTime = Math.floor(Date.now() / 1000);
139
- let tokenTime = token.payload.exp;
147
+ let tokenTime = idToken.payload.exp;
140
148
  let expTime = (tokenTime - currentTime) * 1000;
141
149
  return expTime;
142
150
  }
143
- async getCurrentSession() {
144
- return await fetchAuthSession();
145
- }
146
151
  async handleSignIn({ username, password }) {
147
152
  try {
148
153
  const { isSignedIn, nextStep } = await signIn({ username, password });
@@ -150,11 +155,12 @@ class AnnaLibAuthService {
150
155
  case "DONE":
151
156
  let session = await fetchAuthSession();
152
157
  let newExpTime = this.computeTokenExpiration(session.tokens.idToken);
158
+ this.accessToken = session.tokens.accessToken.toString();
153
159
  localStorage.setItem("accessTokenExpiration", newExpTime.toString());
154
160
  this.refreshAccessToken();
155
161
  this.loginErrorMessage = null;
162
+ await this.consumingProjectAuthService.onSuccessfulAuthenticatingUser(false);
156
163
  this.getAllCognitoTokenAndGroups(session.tokens);
157
- await this.consumingProjectAuthService.onSuccessfulAuthenticatingUser(session.tokens.idToken.payload.sub);
158
164
  break;
159
165
  case "CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED":
160
166
  this.consumingProjectAuthService.isLoggingIn = false;
@@ -192,46 +198,45 @@ class AnnaLibAuthService {
192
198
  }
193
199
  }
194
200
  refreshAccessToken() {
195
- // // let currentUser = this.getCurrentUserDetails();
196
- // let accessTokenExpiration = localStorage.getItem("accessTokenExpiration");
197
- // let expTime = accessTokenExpiration ? parseInt(accessTokenExpiration) : 0;
198
- // this.accessTokenTimerId = setInterval(() => {
199
- // // let counter = 1000;
200
- // // let delayFunction = setTimeout(() => {
201
- // // currentUser && currentUser.getSession((error: any, token: CognitoUserSession | null) => {
202
- // let session = await fetchAuthSession();
203
- // if (session.tokens) {
204
- // this.getAllCognitoTokenAndGroups(session.tokens);
205
- // let newExpTime = this.computeTokenExpiration(this.IdToken);
206
- // if (newExpTime <= 0) {
207
- // newExpTime = 1000;
208
- // counter = 0;
209
- // if (delayFunction) {
210
- // clearInterval(delayFunction);
211
- // }
212
- // }
213
- // expTime = newExpTime;
214
- // localStorage.setItem("accessTokenExpiration", newExpTime.toString());
215
- // clearInterval(this.accessTokenTimerId);
216
- // this.refreshAccessToken();
217
- // } else if (error.code === "NotAuthorizedException") {
218
- // this.toastr.error(LoginConstant.sessionExpiredError);
219
- // this.sessionTimeout();
220
- // }
221
- // });
222
- // // }, counter);
223
- // // }, expTime);
201
+ let accessTokenExpiration = localStorage.getItem("accessTokenExpiration");
202
+ let expTime = accessTokenExpiration ? parseInt(accessTokenExpiration) : 0;
203
+ this.accessTokenTimerId = setInterval(() => {
204
+ let counter = 1000;
205
+ let delayFunction = setTimeout(async () => {
206
+ try {
207
+ let session = await fetchAuthSession();
208
+ let token = session.tokens;
209
+ if (token) {
210
+ this.getAllCognitoTokenAndGroups(token);
211
+ let newExpTime = this.computeTokenExpiration(this.IdToken);
212
+ if (newExpTime <= 0) {
213
+ newExpTime = 1000;
214
+ counter = 0;
215
+ if (delayFunction) {
216
+ clearInterval(delayFunction);
217
+ }
218
+ }
219
+ expTime = newExpTime;
220
+ localStorage.setItem("accessTokenExpiration", newExpTime.toString());
221
+ clearInterval(this.accessTokenTimerId);
222
+ this.refreshAccessToken();
223
+ }
224
+ else {
225
+ this.toastr.error(LoginConstant.sessionExpiredError);
226
+ this.sessionTimeout();
227
+ }
228
+ }
229
+ catch (error) {
230
+ this.toastr.error(LoginConstant.sessionExpiredError);
231
+ this.sessionTimeout();
232
+ }
233
+ }, counter);
234
+ }, expTime);
224
235
  }
225
236
  async changePassword(newPassword) {
226
237
  try {
227
- let session = await fetchAuthSession();
228
- console.log(session);
229
- let oldPassword = this.userPassword;
230
238
  let inputParam = {
231
239
  challengeResponse: newPassword,
232
- options: {
233
- email: 'email@email'
234
- }
235
240
  };
236
241
  const data = await confirmSignIn(inputParam);
237
242
  const { username } = await getCurrentUser();
@@ -466,7 +471,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
466
471
  args: [CONFIG_SERVICE_TOKEN]
467
472
  }] }]; } });
468
473
 
469
- class DuoSsoLoginComponent {
474
+ class SsoLoginComponent {
470
475
  constructor(authService, consumingProjectConfigService) {
471
476
  this.authService = authService;
472
477
  this.consumingProjectConfigService = consumingProjectConfigService;
@@ -478,11 +483,11 @@ class DuoSsoLoginComponent {
478
483
  this.authService.signInWithDuo();
479
484
  }
480
485
  }
481
- 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 });
482
- 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" }] });
483
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DuoSsoLoginComponent, decorators: [{
486
+ 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 });
487
+ 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" }] });
488
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SsoLoginComponent, decorators: [{
484
489
  type: Component,
485
- 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"] }]
490
+ 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"] }]
486
491
  }], ctorParameters: function () { return [{ type: AnnaLibAuthService }, { type: undefined, decorators: [{
487
492
  type: Inject,
488
493
  args: [CONFIG_SERVICE_TOKEN]
@@ -805,12 +810,12 @@ AnnaCognitoLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
805
810
  VersionAndTermPolicyComponent,
806
811
  SurewavesYearLogoComponent,
807
812
  PoweredByLogoTemplateComponent,
808
- DuoSsoLoginComponent], imports: [FormsModule,
813
+ SsoLoginComponent], imports: [FormsModule,
809
814
  ReactiveFormsModule,
810
815
  RouterModule,
811
816
  CommonModule,
812
817
  NgOptimizedImage], exports: [LoginComponent,
813
- DuoSsoLoginComponent,
818
+ SsoLoginComponent,
814
819
  SetNewPasswordComponent,
815
820
  PasswordMatchingComponent,
816
821
  ForgotPasswordComponent,
@@ -837,7 +842,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
837
842
  VersionAndTermPolicyComponent,
838
843
  SurewavesYearLogoComponent,
839
844
  PoweredByLogoTemplateComponent,
840
- DuoSsoLoginComponent,
845
+ SsoLoginComponent,
841
846
  ],
842
847
  imports: [
843
848
  FormsModule,
@@ -848,7 +853,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
848
853
  ],
849
854
  exports: [
850
855
  LoginComponent,
851
- DuoSsoLoginComponent,
856
+ SsoLoginComponent,
852
857
  SetNewPasswordComponent,
853
858
  PasswordMatchingComponent,
854
859
  ForgotPasswordComponent,
@@ -887,5 +892,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
887
892
  * Generated bundle index. Do not edit.
888
893
  */
889
894
 
890
- 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 };
895
+ 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 };
891
896
  //# sourceMappingURL=annalib-anna-cognito-lib.mjs.map