@annalib/anna-cognito-lib 2.2.5 → 2.2.6

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
+ let currentUser = await getCurrentUser();
118
+ if (currentUser) {
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
+ else {
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 });
@@ -153,8 +158,8 @@ class AnnaLibAuthService {
153
158
  localStorage.setItem("accessTokenExpiration", newExpTime.toString());
154
159
  this.refreshAccessToken();
155
160
  this.loginErrorMessage = null;
161
+ await this.consumingProjectAuthService.onSuccessfulAuthenticatingUser(false);
156
162
  this.getAllCognitoTokenAndGroups(session.tokens);
157
- await this.consumingProjectAuthService.onSuccessfulAuthenticatingUser(session.tokens.idToken.payload.sub);
158
163
  break;
159
164
  case "CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED":
160
165
  this.consumingProjectAuthService.isLoggingIn = false;
@@ -192,46 +197,45 @@ class AnnaLibAuthService {
192
197
  }
193
198
  }
194
199
  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);
200
+ let accessTokenExpiration = localStorage.getItem("accessTokenExpiration");
201
+ let expTime = accessTokenExpiration ? parseInt(accessTokenExpiration) : 0;
202
+ this.accessTokenTimerId = setInterval(() => {
203
+ let counter = 1000;
204
+ let delayFunction = setTimeout(async () => {
205
+ try {
206
+ let session = await fetchAuthSession();
207
+ let token = session.tokens;
208
+ if (token) {
209
+ this.getAllCognitoTokenAndGroups(token);
210
+ let newExpTime = this.computeTokenExpiration(this.IdToken);
211
+ if (newExpTime <= 0) {
212
+ newExpTime = 1000;
213
+ counter = 0;
214
+ if (delayFunction) {
215
+ clearInterval(delayFunction);
216
+ }
217
+ }
218
+ expTime = newExpTime;
219
+ localStorage.setItem("accessTokenExpiration", newExpTime.toString());
220
+ clearInterval(this.accessTokenTimerId);
221
+ this.refreshAccessToken();
222
+ }
223
+ else {
224
+ this.toastr.error(LoginConstant.sessionExpiredError);
225
+ this.sessionTimeout();
226
+ }
227
+ }
228
+ catch (error) {
229
+ this.toastr.error(LoginConstant.sessionExpiredError);
230
+ this.sessionTimeout();
231
+ }
232
+ }, counter);
233
+ }, expTime);
224
234
  }
225
235
  async changePassword(newPassword) {
226
236
  try {
227
- let session = await fetchAuthSession();
228
- console.log(session);
229
- let oldPassword = this.userPassword;
230
237
  let inputParam = {
231
238
  challengeResponse: newPassword,
232
- options: {
233
- email: 'email@email'
234
- }
235
239
  };
236
240
  const data = await confirmSignIn(inputParam);
237
241
  const { username } = await getCurrentUser();
@@ -466,7 +470,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
466
470
  args: [CONFIG_SERVICE_TOKEN]
467
471
  }] }]; } });
468
472
 
469
- class DuoSsoLoginComponent {
473
+ class SsoLoginComponent {
470
474
  constructor(authService, consumingProjectConfigService) {
471
475
  this.authService = authService;
472
476
  this.consumingProjectConfigService = consumingProjectConfigService;
@@ -478,11 +482,11 @@ class DuoSsoLoginComponent {
478
482
  this.authService.signInWithDuo();
479
483
  }
480
484
  }
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: [{
485
+ 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 });
486
+ 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" }] });
487
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SsoLoginComponent, decorators: [{
484
488
  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"] }]
489
+ 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
490
  }], ctorParameters: function () { return [{ type: AnnaLibAuthService }, { type: undefined, decorators: [{
487
491
  type: Inject,
488
492
  args: [CONFIG_SERVICE_TOKEN]
@@ -805,12 +809,12 @@ AnnaCognitoLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", ve
805
809
  VersionAndTermPolicyComponent,
806
810
  SurewavesYearLogoComponent,
807
811
  PoweredByLogoTemplateComponent,
808
- DuoSsoLoginComponent], imports: [FormsModule,
812
+ SsoLoginComponent], imports: [FormsModule,
809
813
  ReactiveFormsModule,
810
814
  RouterModule,
811
815
  CommonModule,
812
816
  NgOptimizedImage], exports: [LoginComponent,
813
- DuoSsoLoginComponent,
817
+ SsoLoginComponent,
814
818
  SetNewPasswordComponent,
815
819
  PasswordMatchingComponent,
816
820
  ForgotPasswordComponent,
@@ -837,7 +841,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
837
841
  VersionAndTermPolicyComponent,
838
842
  SurewavesYearLogoComponent,
839
843
  PoweredByLogoTemplateComponent,
840
- DuoSsoLoginComponent,
844
+ SsoLoginComponent,
841
845
  ],
842
846
  imports: [
843
847
  FormsModule,
@@ -848,7 +852,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
848
852
  ],
849
853
  exports: [
850
854
  LoginComponent,
851
- DuoSsoLoginComponent,
855
+ SsoLoginComponent,
852
856
  SetNewPasswordComponent,
853
857
  PasswordMatchingComponent,
854
858
  ForgotPasswordComponent,
@@ -887,5 +891,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
887
891
  * Generated bundle index. Do not edit.
888
892
  */
889
893
 
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 };
894
+ 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
895
  //# sourceMappingURL=annalib-anna-cognito-lib.mjs.map