@idea-ionic/auth 8.11.4 → 8.11.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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Injectable, ChangeDetectionStrategy, Component, input, output } from '@angular/core';
2
+ import { inject, Injectable, model, signal, ChangeDetectionStrategy, Component, input, output } from '@angular/core';
3
3
  import * as i1 from '@angular/forms';
4
4
  import { FormsModule } from '@angular/forms';
5
5
  import { NavController, IonButton, IonText, IonCol, IonRow, IonIcon, IonLabel, IonCardSubtitle, IonCardTitle, IonCardHeader, IonImg, IonCardContent, IonCard, IonContent, IonItem, IonInput, IonCheckbox, PopoverController, ModalController, IonListHeader, IonList, IonTitle, IonButtons, IonToolbar, IonHeader } from '@ionic/angular/standalone';
@@ -1538,8 +1538,13 @@ class IDEASignInPage {
1538
1538
  this._translate = inject(IDEATranslationsService);
1539
1539
  this._auth = inject(IDEAAuthService);
1540
1540
  this.doneExternalProviderCheck = false;
1541
+ this.email = model(/* @ts-ignore */
1542
+ ...(ngDevMode ? [undefined, { debugName: "email" }] : /* istanbul ignore next */ []));
1541
1543
  this.agreementsCheck = true;
1542
- this.newAccountRegistered = false;
1544
+ this.newAccountRegistered = signal(false, /* @ts-ignore */
1545
+ ...(ngDevMode ? [{ debugName: "newAccountRegistered" }] : /* istanbul ignore next */ []));
1546
+ this.errorMsg = signal(null, /* @ts-ignore */
1547
+ ...(ngDevMode ? [{ debugName: "errorMsg" }] : /* istanbul ignore next */ []));
1543
1548
  this.darkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
1544
1549
  this.title = this._env.idea.auth.title;
1545
1550
  this.registrationPossible = this._env.idea.auth.registrationIsPossible;
@@ -1549,17 +1554,17 @@ class IDEASignInPage {
1549
1554
  }
1550
1555
  ionViewDidEnter() {
1551
1556
  // manage the scenario in which we just created a new account (show a explanatory message: email must be confirmed)
1552
- this.newAccountRegistered = !!this._auth.getNewAccountJustRegistered();
1553
- if (this.newAccountRegistered)
1554
- this.email = this._auth.getNewAccountJustRegistered();
1557
+ this.newAccountRegistered.set(!!this._auth.getNewAccountJustRegistered());
1558
+ if (this.newAccountRegistered())
1559
+ this.email.set(this._auth.getNewAccountJustRegistered());
1555
1560
  }
1556
1561
  async login() {
1557
1562
  if (!this.agreementsCheck)
1558
1563
  return;
1559
1564
  try {
1560
- this.errorMsg = null;
1565
+ this.errorMsg.set(null);
1561
1566
  await this._loading.show();
1562
- const loginAction = await this._auth.login(this.email, this.password);
1567
+ const loginAction = await this._auth.login(this.email(), this.password);
1563
1568
  if (loginAction === LoginOutcomeActions.NEW_PASSWORD)
1564
1569
  this._nav.navigateForward(['auth', 'new-password']);
1565
1570
  else if (loginAction === LoginOutcomeActions.MFA_CHALLENGE)
@@ -1571,10 +1576,10 @@ class IDEASignInPage {
1571
1576
  }
1572
1577
  catch (err) {
1573
1578
  if (err.name === 'UserNotConfirmedException')
1574
- this.errorMsg = this._translate._('IDEA_AUTH.CONFIRM_YOUR_EMAIL_TO_LOGIN');
1579
+ this.errorMsg.set(this._translate._('IDEA_AUTH.CONFIRM_YOUR_EMAIL_TO_LOGIN'));
1575
1580
  else if (err.name === 'UserLambdaValidationException' &&
1576
1581
  err.message?.includes('@IDEA_COGNITO_TRANSITION'))
1577
- this.errorMsg = this._translate._('IDEA_AUTH.CHANGE_YOUR_PASSWORD_TO_LOGIN');
1582
+ this.errorMsg.set(this._translate._('IDEA_AUTH.CHANGE_YOUR_PASSWORD_TO_LOGIN'));
1578
1583
  this._message.error('IDEA_AUTH.AUTHENTICATION_FAILED');
1579
1584
  }
1580
1585
  finally {
@@ -1582,9 +1587,9 @@ class IDEASignInPage {
1582
1587
  }
1583
1588
  }
1584
1589
  checkForExternalProviderEmail() {
1585
- if (isEmpty(this.email, 'email'))
1590
+ if (isEmpty(this.email(), 'email'))
1586
1591
  return;
1587
- const emailDomain = this.email.split('@')[1];
1592
+ const emailDomain = this.email().split('@')[1];
1588
1593
  this.doneExternalProviderCheck = true;
1589
1594
  const provider = this.externalProviders.find(p => p.emailDomains.includes(emailDomain));
1590
1595
  if (provider)
@@ -1606,9 +1611,9 @@ class IDEASignInPage {
1606
1611
  await Browser.open({ url });
1607
1612
  }
1608
1613
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: IDEASignInPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1609
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: IDEASignInPage, isStandalone: true, selector: "idea-sign-in", ngImport: i0, template: `
1614
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: IDEASignInPage, isStandalone: true, selector: "idea-sign-in", inputs: { email: { classPropertyName: "email", publicName: "email", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { email: "emailChange" }, ngImport: i0, template: `
1610
1615
  <ion-content>
1611
- @if (newAccountRegistered) {
1616
+ @if (newAccountRegistered()) {
1612
1617
  <ion-card color="warning">
1613
1618
  <ion-card-content>{{ 'IDEA_AUTH.CONFIRM_YOUR_EMAIL_TO_LOGIN' | translate }}</ion-card-content>
1614
1619
  </ion-card>
@@ -1629,9 +1634,9 @@ class IDEASignInPage {
1629
1634
  }
1630
1635
  </ion-card-header>
1631
1636
  <ion-card-content>
1632
- @if (errorMsg) {
1637
+ @if (errorMsg()) {
1633
1638
  <p testId="signin.error" class="errorBox">
1634
- <b>{{ 'IDEA_AUTH.WARNING' | translate }}.</b> {{ errorMsg }}
1639
+ <b>{{ 'IDEA_AUTH.WARNING' | translate }}.</b> {{ errorMsg() }}
1635
1640
  </p>
1636
1641
  }
1637
1642
  <ion-item>
@@ -1823,7 +1828,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
1823
1828
  IonCheckbox
1824
1829
  ], changeDetection: ChangeDetectionStrategy.OnPush, template: `
1825
1830
  <ion-content>
1826
- @if (newAccountRegistered) {
1831
+ @if (newAccountRegistered()) {
1827
1832
  <ion-card color="warning">
1828
1833
  <ion-card-content>{{ 'IDEA_AUTH.CONFIRM_YOUR_EMAIL_TO_LOGIN' | translate }}</ion-card-content>
1829
1834
  </ion-card>
@@ -1844,9 +1849,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
1844
1849
  }
1845
1850
  </ion-card-header>
1846
1851
  <ion-card-content>
1847
- @if (errorMsg) {
1852
+ @if (errorMsg()) {
1848
1853
  <p testId="signin.error" class="errorBox">
1849
- <b>{{ 'IDEA_AUTH.WARNING' | translate }}.</b> {{ errorMsg }}
1854
+ <b>{{ 'IDEA_AUTH.WARNING' | translate }}.</b> {{ errorMsg() }}
1850
1855
  </p>
1851
1856
  }
1852
1857
  <ion-item>
@@ -2014,7 +2019,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
2014
2019
  </form>
2015
2020
  </ion-content>
2016
2021
  `, styles: [".flexBox{background:var(--idea-auth-background-color, var(--ion-color-white-shade))}.authCard{min-width:400px;max-width:550px;margin:0 10px;padding:20px;background-color:var(--idea-auth-card-background-color, var(--ion-color-white));border:1px solid var(--idea-auth-card-border-color, var(--ion-color-light));border-radius:10px;box-shadow:none;text-align:center}.authCard ion-img{width:150px;display:block;margin:0 auto}.authCard ion-card-title{font-family:auth-title;font-size:3em}.authCard ion-card-subtitle{font-family:auth-title;font-size:1.2em}.authCard ion-card-content{padding-top:16px}.authCard ion-card-content .errorBox{padding-left:10px;margin-bottom:20px;text-align:left;border-left:2px solid var(--ion-color-danger)}.authCard ion-card-content ion-item{--ion-item-background: var(--idea-auth-card-background-color, var(--ion-color-white));--border-color: var(--idea-auth-card-border-color, var(--ion-color-light))}.authCard ion-card-content ion-label[position=inline] ion-icon{padding-top:4px;padding-right:5px;font-size:1.3em}.authCard ion-card-content .agreementsAcceptanceRow{margin-top:15px;font-size:.9em}.authCard ion-card-content .agreementsAcceptanceRow ion-checkbox{vertical-align:bottom;margin-right:3px}.authCard ion-card-content ion-button:not([slot=end]){margin-top:15px}.authCard ion-card-content .smallCaseButton{text-transform:none;letter-spacing:normal;font-size:1em}@media only screen and (max-width:500px){.authCard{background-color:transparent;border:none}}.ideaLogo{width:65px;margin:40px auto 0;cursor:pointer}.passwordPolicyPopover{--width: 350px}\n"] }]
2017
- }], ctorParameters: () => [] });
2022
+ }], ctorParameters: () => [], propDecorators: { email: [{ type: i0.Input, args: [{ isSignal: true, alias: "email", required: false }] }, { type: i0.Output, args: ["emailChange"] }] } });
2018
2023
 
2019
2024
  class IDEAPasswordPolicyComponent {
2020
2025
  constructor() {
@@ -2101,6 +2106,8 @@ class IDEASignUpPage {
2101
2106
  this._translate = inject(IDEATranslationsService);
2102
2107
  this._auth = inject(IDEAAuthService);
2103
2108
  this.agreementsCheck = false;
2109
+ this.errorMsg = signal(null, /* @ts-ignore */
2110
+ ...(ngDevMode ? [{ debugName: "errorMsg" }] : /* istanbul ignore next */ []));
2104
2111
  this.passwordPolicy = this._env.idea.auth.passwordPolicy;
2105
2112
  }
2106
2113
  ngOnInit() {
@@ -2115,9 +2122,9 @@ class IDEASignUpPage {
2115
2122
  async register() {
2116
2123
  try {
2117
2124
  await this._loading.show();
2118
- this.errorMsg = null;
2125
+ this.errorMsg.set(null);
2119
2126
  if (isEmpty(this.email, 'email'))
2120
- this.errorMsg = this._translate._('IDEA_AUTH.VALID_EMAIL_OBLIGATORY');
2127
+ this.errorMsg.set(this._translate._('IDEA_AUTH.VALID_EMAIL_OBLIGATORY'));
2121
2128
  else {
2122
2129
  const errors = this._auth.validatePasswordAgainstPolicy(this.password);
2123
2130
  if (errors.length === 0 && this.passwordPolicy.advancedPasswordCheck) {
@@ -2125,19 +2132,19 @@ class IDEASignUpPage {
2125
2132
  errors.push(...(await this._auth.validatePasswordAgainstDatabases(this.password, emailParts)));
2126
2133
  }
2127
2134
  if (errors.length)
2128
- this.errorMsg = [
2135
+ this.errorMsg.set([
2129
2136
  this._translate._('IDEA_AUTH.PASSWORD_REQUIREMENTS_FOLLOW'),
2130
2137
  ...errors.map(x => this._translate._('IDEA_AUTH.PASSWORD_REQUIREMENTS.'.concat(x), { n: this.passwordPolicy.minLength }))
2131
- ].join(' ');
2138
+ ].join(' '));
2132
2139
  }
2133
- if (this.errorMsg)
2140
+ if (this.errorMsg())
2134
2141
  return this._message.error('IDEA_AUTH.REGISTRATION_FAILED');
2135
2142
  await this._auth.register(this.email, this.password);
2136
2143
  this._message.success('IDEA_AUTH.REGISTRATION_COMPLETED');
2137
2144
  this.goToAuth();
2138
2145
  }
2139
2146
  catch (err) {
2140
- this.errorMsg = err.message;
2147
+ this.errorMsg.set(err.message);
2141
2148
  this._message.error('IDEA_AUTH.REGISTRATION_FAILED');
2142
2149
  }
2143
2150
  finally {
@@ -2168,10 +2175,10 @@ class IDEASignUpPage {
2168
2175
  <ion-card-subtitle>{{ 'IDEA_AUTH.REGISTER_A_NEW_ACCOUNT_TO_THE_SYSTEM' | translate }}</ion-card-subtitle>
2169
2176
  </ion-card-header>
2170
2177
  <ion-card-content>
2171
- @if (errorMsg) {
2178
+ @if (errorMsg()) {
2172
2179
  <p testId="signup.error" class="errorBox">
2173
2180
  <b> {{ 'IDEA_AUTH.ERROR' | translate }}. </b>
2174
- {{ errorMsg }}
2181
+ {{ errorMsg() }}
2175
2182
  </p>
2176
2183
  }
2177
2184
  <ion-item>
@@ -2326,10 +2333,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
2326
2333
  <ion-card-subtitle>{{ 'IDEA_AUTH.REGISTER_A_NEW_ACCOUNT_TO_THE_SYSTEM' | translate }}</ion-card-subtitle>
2327
2334
  </ion-card-header>
2328
2335
  <ion-card-content>
2329
- @if (errorMsg) {
2336
+ @if (errorMsg()) {
2330
2337
  <p testId="signup.error" class="errorBox">
2331
2338
  <b> {{ 'IDEA_AUTH.ERROR' | translate }}. </b>
2332
- {{ errorMsg }}
2339
+ {{ errorMsg() }}
2333
2340
  </p>
2334
2341
  }
2335
2342
  <ion-item>
@@ -2465,6 +2472,8 @@ class IDEANewPasswordPage {
2465
2472
  this._loading = inject(IDEALoadingService);
2466
2473
  this._translate = inject(IDEATranslationsService);
2467
2474
  this._auth = inject(IDEAAuthService);
2475
+ this.errorMsg = signal(null, /* @ts-ignore */
2476
+ ...(ngDevMode ? [{ debugName: "errorMsg" }] : /* istanbul ignore next */ []));
2468
2477
  this.passwordPolicy = this._env.idea.auth.passwordPolicy;
2469
2478
  }
2470
2479
  ngOnInit() {
@@ -2474,22 +2483,22 @@ class IDEANewPasswordPage {
2474
2483
  async confirmNewPassword() {
2475
2484
  try {
2476
2485
  await this._loading.show();
2477
- this.errorMsg = null;
2486
+ this.errorMsg.set(null);
2478
2487
  const errors = this._auth.validatePasswordAgainstPolicy(this.newPassword);
2479
2488
  if (errors.length === 0 && this.passwordPolicy.advancedPasswordCheck)
2480
2489
  errors.push(...(await this._auth.validatePasswordAgainstDatabases(this.newPassword)));
2481
2490
  if (errors.length)
2482
- this.errorMsg = [
2491
+ this.errorMsg.set([
2483
2492
  this._translate._('IDEA_AUTH.PASSWORD_REQUIREMENTS_FOLLOW'),
2484
2493
  ...errors.map(x => this._translate._('IDEA_AUTH.PASSWORD_REQUIREMENTS.'.concat(x), { n: this.passwordPolicy.minLength }))
2485
- ].join(' ');
2486
- if (this.errorMsg)
2494
+ ].join(' '));
2495
+ if (this.errorMsg())
2487
2496
  return this._message.error('IDEA_AUTH.PASSWORD_REQUIREMENTS_FOLLOW');
2488
2497
  await this._auth.confirmNewPassword(this.newPassword);
2489
2498
  window.location.assign('');
2490
2499
  }
2491
2500
  catch (error) {
2492
- this.errorMsg = error.message;
2501
+ this.errorMsg.set(error.message);
2493
2502
  this._message.error('IDEA_AUTH.PASSWORD_REQUIREMENTS_FOLLOW');
2494
2503
  }
2495
2504
  finally {
@@ -2514,10 +2523,10 @@ class IDEANewPasswordPage {
2514
2523
  <ion-card-subtitle>{{ 'IDEA_AUTH.YOU_NEED_TO_CHOOSE_A_NEW_PASSWORD' | translate }}</ion-card-subtitle>
2515
2524
  </ion-card-header>
2516
2525
  <ion-card-content>
2517
- @if (errorMsg) {
2526
+ @if (errorMsg()) {
2518
2527
  <p testId="newpassword.error" class="errorBox">
2519
2528
  <b> {{ 'IDEA_AUTH.ERROR' | translate }}. </b>
2520
- {{ errorMsg }}
2529
+ {{ errorMsg() }}
2521
2530
  </p>
2522
2531
  }
2523
2532
  <ion-item>
@@ -2597,10 +2606,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
2597
2606
  <ion-card-subtitle>{{ 'IDEA_AUTH.YOU_NEED_TO_CHOOSE_A_NEW_PASSWORD' | translate }}</ion-card-subtitle>
2598
2607
  </ion-card-header>
2599
2608
  <ion-card-content>
2600
- @if (errorMsg) {
2609
+ @if (errorMsg()) {
2601
2610
  <p testId="newpassword.error" class="errorBox">
2602
2611
  <b> {{ 'IDEA_AUTH.ERROR' | translate }}. </b>
2603
- {{ errorMsg }}
2612
+ {{ errorMsg() }}
2604
2613
  </p>
2605
2614
  }
2606
2615
  <ion-item>
@@ -2663,11 +2672,13 @@ class IDEAResendLinkPage {
2663
2672
  this._loading = inject(IDEALoadingService);
2664
2673
  this._auth = inject(IDEAAuthService);
2665
2674
  this._translate = inject(IDEATranslationsService);
2675
+ this.errorMsg = signal(null, /* @ts-ignore */
2676
+ ...(ngDevMode ? [{ debugName: "errorMsg" }] : /* istanbul ignore next */ []));
2666
2677
  }
2667
2678
  async resendConfirmationLink() {
2668
- this.errorMsg = null;
2679
+ this.errorMsg.set(null);
2669
2680
  if (!this.email) {
2670
- this.errorMsg = this._translate._('IDEA_AUTH.VALID_EMAIL_OBLIGATORY');
2681
+ this.errorMsg.set(this._translate._('IDEA_AUTH.VALID_EMAIL_OBLIGATORY'));
2671
2682
  this._message.error('IDEA_AUTH.SENDING_FAILED');
2672
2683
  return;
2673
2684
  }
@@ -2678,7 +2689,7 @@ class IDEAResendLinkPage {
2678
2689
  this.goToAuth();
2679
2690
  }
2680
2691
  catch (error) {
2681
- this.errorMsg = this._translate._('IDEA_AUTH.IS_THE_EMAIL_CORRECT');
2692
+ this.errorMsg.set(this._translate._('IDEA_AUTH.IS_THE_EMAIL_CORRECT'));
2682
2693
  this._message.error('IDEA_AUTH.SENDING_FAILED');
2683
2694
  }
2684
2695
  finally {
@@ -2698,10 +2709,10 @@ class IDEAResendLinkPage {
2698
2709
  <ion-card-subtitle>{{ 'IDEA_AUTH.RESEND_CONFIRMATION_LINK_HINT' | translate }}</ion-card-subtitle>
2699
2710
  </ion-card-header>
2700
2711
  <ion-card-content>
2701
- @if (errorMsg) {
2712
+ @if (errorMsg()) {
2702
2713
  <p testId="resendlink.error" class="errorBox">
2703
2714
  <b> {{ 'IDEA_AUTH.ERROR' | translate }}. </b>
2704
- {{ errorMsg }}
2715
+ {{ errorMsg() }}
2705
2716
  </p>
2706
2717
  }
2707
2718
  <ion-item>
@@ -2773,10 +2784,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
2773
2784
  <ion-card-subtitle>{{ 'IDEA_AUTH.RESEND_CONFIRMATION_LINK_HINT' | translate }}</ion-card-subtitle>
2774
2785
  </ion-card-header>
2775
2786
  <ion-card-content>
2776
- @if (errorMsg) {
2787
+ @if (errorMsg()) {
2777
2788
  <p testId="resendlink.error" class="errorBox">
2778
2789
  <b> {{ 'IDEA_AUTH.ERROR' | translate }}. </b>
2779
- {{ errorMsg }}
2790
+ {{ errorMsg() }}
2780
2791
  </p>
2781
2792
  }
2782
2793
  <ion-item>
@@ -3002,6 +3013,8 @@ class IDEAConfirmPasswordPage {
3002
3013
  this._loading = inject(IDEALoadingService);
3003
3014
  this._translate = inject(IDEATranslationsService);
3004
3015
  this._auth = inject(IDEAAuthService);
3016
+ this.errorMsg = signal(null, /* @ts-ignore */
3017
+ ...(ngDevMode ? [{ debugName: "errorMsg" }] : /* istanbul ignore next */ []));
3005
3018
  this.passwordPolicy = this._env.idea.auth.passwordPolicy;
3006
3019
  }
3007
3020
  ngOnInit() {
@@ -3013,25 +3026,25 @@ class IDEAConfirmPasswordPage {
3013
3026
  async confirmPassword() {
3014
3027
  try {
3015
3028
  await this._loading.show();
3016
- this.errorMsg = null;
3029
+ this.errorMsg.set(null);
3017
3030
  const errors = this._auth.validatePasswordAgainstPolicy(this.newPassword);
3018
3031
  if (errors.length === 0 && this.passwordPolicy.advancedPasswordCheck) {
3019
3032
  const emailParts = [...this.email?.split('@')[0].split(/\W/g)];
3020
3033
  errors.push(...(await this._auth.validatePasswordAgainstDatabases(this.newPassword, emailParts)));
3021
3034
  }
3022
3035
  if (errors.length)
3023
- this.errorMsg = [
3036
+ this.errorMsg.set([
3024
3037
  this._translate._('IDEA_AUTH.PASSWORD_REQUIREMENTS_FOLLOW'),
3025
3038
  ...errors.map(x => this._translate._('IDEA_AUTH.PASSWORD_REQUIREMENTS.'.concat(x), { n: this.passwordPolicy.minLength }))
3026
- ].join(' ');
3027
- if (this.errorMsg)
3039
+ ].join(' '));
3040
+ if (this.errorMsg())
3028
3041
  return this._message.error('IDEA_AUTH.PASSWORD_REQUIREMENTS_FOLLOW');
3029
3042
  await this._auth.confirmPassword(this.email, this.code, this.newPassword);
3030
3043
  this._message.success('IDEA_AUTH.PASSWORD_CHANGED');
3031
3044
  this.goToAuth();
3032
3045
  }
3033
3046
  catch (error) {
3034
- this.errorMsg = error.message;
3047
+ this.errorMsg.set(error.message);
3035
3048
  this._message.error('IDEA_AUTH.PASSWORD_REQUIREMENTS_FOLLOW');
3036
3049
  }
3037
3050
  finally {
@@ -3058,10 +3071,10 @@ class IDEAConfirmPasswordPage {
3058
3071
  <ion-card-title color="primary">{{ 'IDEA_AUTH.CHANGE_THE_PASSWORD' | translate }}</ion-card-title>
3059
3072
  </ion-card-header>
3060
3073
  <ion-card-content>
3061
- @if (errorMsg) {
3074
+ @if (errorMsg()) {
3062
3075
  <p testId="confirmpassword.error" class="errorBox">
3063
3076
  <b> {{ 'IDEA_AUTH.ERROR' | translate }}. </b>
3064
- {{ errorMsg }}
3077
+ {{ errorMsg() }}
3065
3078
  </p>
3066
3079
  }
3067
3080
  <ion-item>
@@ -3185,10 +3198,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
3185
3198
  <ion-card-title color="primary">{{ 'IDEA_AUTH.CHANGE_THE_PASSWORD' | translate }}</ion-card-title>
3186
3199
  </ion-card-header>
3187
3200
  <ion-card-content>
3188
- @if (errorMsg) {
3201
+ @if (errorMsg()) {
3189
3202
  <p testId="confirmpassword.error" class="errorBox">
3190
3203
  <b> {{ 'IDEA_AUTH.ERROR' | translate }}. </b>
3191
- {{ errorMsg }}
3204
+ {{ errorMsg() }}
3192
3205
  </p>
3193
3206
  }
3194
3207
  <ion-item>
@@ -3297,6 +3310,8 @@ class IDEAMFAChallengePage {
3297
3310
  this._loading = inject(IDEALoadingService);
3298
3311
  this._auth = inject(IDEAAuthService);
3299
3312
  this._translate = inject(IDEATranslationsService);
3313
+ this.errorMsg = signal(null, /* @ts-ignore */
3314
+ ...(ngDevMode ? [{ debugName: "errorMsg" }] : /* istanbul ignore next */ []));
3300
3315
  }
3301
3316
  ngOnInit() {
3302
3317
  if (!this._auth.challengeUsername)
@@ -3304,14 +3319,14 @@ class IDEAMFAChallengePage {
3304
3319
  }
3305
3320
  async completeMFAChallenge() {
3306
3321
  try {
3307
- this.errorMsg = null;
3322
+ this.errorMsg.set(null);
3308
3323
  await this._loading.show();
3309
3324
  await this._auth.completeMFAChallenge(this.otpCode);
3310
3325
  window.location.assign('');
3311
3326
  }
3312
3327
  catch (error) {
3313
- this.errorMsg = this._translate._('IDEA_AUTH.INVALID_OTP_CODE');
3314
- this._message.error(this.errorMsg, { dontTranslate: true });
3328
+ this.errorMsg.set(this._translate._('IDEA_AUTH.INVALID_OTP_CODE'));
3329
+ this._message.error(this.errorMsg(), { dontTranslate: true });
3315
3330
  }
3316
3331
  finally {
3317
3332
  this._loading.hide();
@@ -3330,10 +3345,10 @@ class IDEAMFAChallengePage {
3330
3345
  <ion-card-subtitle>{{ 'IDEA_AUTH.ENTER_OTP_CODE_I' | translate }}</ion-card-subtitle>
3331
3346
  </ion-card-header>
3332
3347
  <ion-card-content>
3333
- @if (errorMsg) {
3348
+ @if (errorMsg()) {
3334
3349
  <p testId="mfachallenge.error" class="errorBox">
3335
3350
  <b>{{ 'IDEA_AUTH.ERROR' | translate }}.</b>
3336
- {{ errorMsg }}
3351
+ {{ errorMsg() }}
3337
3352
  </p>
3338
3353
  }
3339
3354
  <ion-item>
@@ -3399,10 +3414,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
3399
3414
  <ion-card-subtitle>{{ 'IDEA_AUTH.ENTER_OTP_CODE_I' | translate }}</ion-card-subtitle>
3400
3415
  </ion-card-header>
3401
3416
  <ion-card-content>
3402
- @if (errorMsg) {
3417
+ @if (errorMsg()) {
3403
3418
  <p testId="mfachallenge.error" class="errorBox">
3404
3419
  <b>{{ 'IDEA_AUTH.ERROR' | translate }}.</b>
3405
- {{ errorMsg }}
3420
+ {{ errorMsg() }}
3406
3421
  </p>
3407
3422
  }
3408
3423
  <ion-item>
@@ -3450,12 +3465,14 @@ class IDEASetupMFAModalComponent {
3450
3465
  this._loading = inject(IDEALoadingService);
3451
3466
  this._message = inject(IDEAMessageService);
3452
3467
  this._auth = inject(IDEAAuthService);
3468
+ this.isMFAEnabled = signal(undefined, /* @ts-ignore */
3469
+ ...(ngDevMode ? [{ debugName: "isMFAEnabled" }] : /* istanbul ignore next */ []));
3453
3470
  }
3454
3471
  async ngOnInit() {
3455
3472
  try {
3456
3473
  await this._loading.show();
3457
- this.isMFAEnabled = await this._auth.checkIfUserHasMFAEnabled(true);
3458
- if (!this.isMFAEnabled) {
3474
+ this.isMFAEnabled.set(await this._auth.checkIfUserHasMFAEnabled(true));
3475
+ if (!this.isMFAEnabled()) {
3459
3476
  const url = await this._auth.getURLForEnablingMFA();
3460
3477
  await this.generateQRCodeCanvasByURL(url);
3461
3478
  }
@@ -3491,7 +3508,7 @@ class IDEASetupMFAModalComponent {
3491
3508
  await this._auth.enableMFA(this.otpCode);
3492
3509
  else
3493
3510
  await this._auth.disableMFA(this.otpCode);
3494
- this.isMFAEnabled = enable;
3511
+ this.isMFAEnabled.set(enable);
3495
3512
  this._message.success('COMMON.OPERATION_COMPLETED');
3496
3513
  this._modal.dismiss({ enabled: enable });
3497
3514
  }
@@ -3514,20 +3531,20 @@ class IDEASetupMFAModalComponent {
3514
3531
  <ion-icon name="close-circle-outline" slot="icon-only" />
3515
3532
  </ion-button>
3516
3533
  </ion-buttons>
3517
- <ion-title>{{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.SETUP_MFA') | translate }}</ion-title>
3534
+ <ion-title>{{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.SETUP_MFA') | translate }}</ion-title>
3518
3535
  </ion-toolbar>
3519
3536
  </ion-header>
3520
3537
  <ion-content class="ion-padding">
3521
3538
  <ion-list class="aList">
3522
3539
  <ion-list-header>
3523
3540
  <ion-label class="ion-text-center">
3524
- <h2>{{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA_I' : 'IDEA_AUTH.SETUP_MFA_I') | translate }}</h2>
3525
- <p>{{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA_II' : 'IDEA_AUTH.SETUP_MFA_II') | translate }}</p>
3541
+ <h2>{{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA_I' : 'IDEA_AUTH.SETUP_MFA_I') | translate }}</h2>
3542
+ <p>{{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA_II' : 'IDEA_AUTH.SETUP_MFA_II') | translate }}</p>
3526
3543
  </ion-label>
3527
3544
  </ion-list-header>
3528
3545
  <ion-card color="white">
3529
3546
  <ion-card-content>
3530
- @if (!isMFAEnabled) {
3547
+ @if (!isMFAEnabled()) {
3531
3548
  <div id="qrCodeContainer"></div>
3532
3549
  }
3533
3550
  <ion-item color="light">
@@ -3539,8 +3556,8 @@ class IDEASetupMFAModalComponent {
3539
3556
  [(ngModel)]="otpCode"
3540
3557
  />
3541
3558
  </ion-item>
3542
- <ion-button expand="block" class="ion-margin-top" [disabled]="!otpCode" (click)="setMFA(!isMFAEnabled)">
3543
- {{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.ENABLE_MFA') | translate }}
3559
+ <ion-button expand="block" class="ion-margin-top" [disabled]="!otpCode" (click)="setMFA(!isMFAEnabled())">
3560
+ {{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.ENABLE_MFA') | translate }}
3544
3561
  </ion-button>
3545
3562
  </ion-card-content>
3546
3563
  </ion-card>
@@ -3575,20 +3592,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
3575
3592
  <ion-icon name="close-circle-outline" slot="icon-only" />
3576
3593
  </ion-button>
3577
3594
  </ion-buttons>
3578
- <ion-title>{{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.SETUP_MFA') | translate }}</ion-title>
3595
+ <ion-title>{{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.SETUP_MFA') | translate }}</ion-title>
3579
3596
  </ion-toolbar>
3580
3597
  </ion-header>
3581
3598
  <ion-content class="ion-padding">
3582
3599
  <ion-list class="aList">
3583
3600
  <ion-list-header>
3584
3601
  <ion-label class="ion-text-center">
3585
- <h2>{{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA_I' : 'IDEA_AUTH.SETUP_MFA_I') | translate }}</h2>
3586
- <p>{{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA_II' : 'IDEA_AUTH.SETUP_MFA_II') | translate }}</p>
3602
+ <h2>{{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA_I' : 'IDEA_AUTH.SETUP_MFA_I') | translate }}</h2>
3603
+ <p>{{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA_II' : 'IDEA_AUTH.SETUP_MFA_II') | translate }}</p>
3587
3604
  </ion-label>
3588
3605
  </ion-list-header>
3589
3606
  <ion-card color="white">
3590
3607
  <ion-card-content>
3591
- @if (!isMFAEnabled) {
3608
+ @if (!isMFAEnabled()) {
3592
3609
  <div id="qrCodeContainer"></div>
3593
3610
  }
3594
3611
  <ion-item color="light">
@@ -3600,8 +3617,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
3600
3617
  [(ngModel)]="otpCode"
3601
3618
  />
3602
3619
  </ion-item>
3603
- <ion-button expand="block" class="ion-margin-top" [disabled]="!otpCode" (click)="setMFA(!isMFAEnabled)">
3604
- {{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.ENABLE_MFA') | translate }}
3620
+ <ion-button expand="block" class="ion-margin-top" [disabled]="!otpCode" (click)="setMFA(!isMFAEnabled())">
3621
+ {{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.ENABLE_MFA') | translate }}
3605
3622
  </ion-button>
3606
3623
  </ion-card-content>
3607
3624
  </ion-card>
@@ -3628,15 +3645,17 @@ class IDEASetupMFAButtonComponent {
3628
3645
  * Trigger then the MFA setup changes.
3629
3646
  */
3630
3647
  this.change = output();
3648
+ this.isMFAEnabled = signal(undefined, /* @ts-ignore */
3649
+ ...(ngDevMode ? [{ debugName: "isMFAEnabled" }] : /* istanbul ignore next */ []));
3631
3650
  }
3632
3651
  async ngOnInit() {
3633
- this.isMFAEnabled = await this._auth.checkIfUserHasMFAEnabled(true);
3652
+ this.isMFAEnabled.set(await this._auth.checkIfUserHasMFAEnabled(true));
3634
3653
  }
3635
3654
  async openMFAModal() {
3636
3655
  const modal = await this._modal.create({ component: IDEASetupMFAModalComponent, backdropDismiss: false });
3637
3656
  modal.onDidDismiss().then(({ data }) => {
3638
3657
  if (data) {
3639
- this.isMFAEnabled = data.enabled;
3658
+ this.isMFAEnabled.set(data.enabled);
3640
3659
  this.change.emit(data.enabled);
3641
3660
  }
3642
3661
  });
@@ -3644,9 +3663,9 @@ class IDEASetupMFAButtonComponent {
3644
3663
  }
3645
3664
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: IDEASetupMFAButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3646
3665
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: IDEASetupMFAButtonComponent, isStandalone: true, selector: "idea-setup-mfa-button", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, ngImport: i0, template: `
3647
- @if (isMFAEnabled !== undefined) {
3666
+ @if (isMFAEnabled() !== undefined) {
3648
3667
  <ion-button [color]="color()" [fill]="fill()" (click)="openMFAModal()">
3649
- {{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.SETUP_MFA') | translate }}
3668
+ {{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.SETUP_MFA') | translate }}
3650
3669
  </ion-button>
3651
3670
  }
3652
3671
  `, isInline: true, dependencies: [{ kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "pipe", type: IDEATranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
@@ -3658,9 +3677,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
3658
3677
  imports: [IDEATranslatePipe, IonButton],
3659
3678
  changeDetection: ChangeDetectionStrategy.OnPush,
3660
3679
  template: `
3661
- @if (isMFAEnabled !== undefined) {
3680
+ @if (isMFAEnabled() !== undefined) {
3662
3681
  <ion-button [color]="color()" [fill]="fill()" (click)="openMFAModal()">
3663
- {{ (isMFAEnabled ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.SETUP_MFA') | translate }}
3682
+ {{ (isMFAEnabled() ? 'IDEA_AUTH.DISABLE_MFA' : 'IDEA_AUTH.SETUP_MFA') | translate }}
3664
3683
  </ion-button>
3665
3684
  }
3666
3685
  `
@@ -3748,7 +3767,12 @@ class IDEAOktaPage {
3748
3767
  this._route = inject(ActivatedRoute);
3749
3768
  this._router = inject(Router);
3750
3769
  this._env = inject(IDEAEnvironment);
3751
- this.go = false;
3770
+ this.identityProvider = signal(null, /* @ts-ignore */
3771
+ ...(ngDevMode ? [{ debugName: "identityProvider" }] : /* istanbul ignore next */ []));
3772
+ this.code = signal(null, /* @ts-ignore */
3773
+ ...(ngDevMode ? [{ debugName: "code" }] : /* istanbul ignore next */ []));
3774
+ this.go = signal(false, /* @ts-ignore */
3775
+ ...(ngDevMode ? [{ debugName: "go" }] : /* istanbul ignore next */ []));
3752
3776
  this.domain = this._env.aws.cognito.domain;
3753
3777
  this.clientId = this._env.aws.cognito.userPoolClientId;
3754
3778
  this.redirectURI = `${window.location.origin}${window.location.pathname}`; // Cognito client must include this callback
@@ -3757,19 +3781,19 @@ class IDEAOktaPage {
3757
3781
  this.darkMode = window.matchMedia('(prefers-color-scheme: dark)').matches;
3758
3782
  }
3759
3783
  ionViewWillEnter() {
3760
- this.identityProvider = this._route.snapshot.queryParamMap.get('provider');
3761
- this.code = this._route.snapshot.queryParamMap.get('code');
3762
- this.go = !!this._route.snapshot.queryParamMap.get('go');
3784
+ this.identityProvider.set(this._route.snapshot.queryParamMap.get('provider'));
3785
+ this.code.set(this._route.snapshot.queryParamMap.get('code'));
3786
+ this.go.set(!!this._route.snapshot.queryParamMap.get('go'));
3763
3787
  this._router.navigate([], { queryParams: {}, replaceUrl: true });
3764
- if (this.code)
3788
+ if (this.code())
3765
3789
  this.endLogin();
3766
- else if (this.identityProvider && this.go)
3790
+ else if (this.identityProvider() && this.go())
3767
3791
  this.startLogin();
3768
3792
  }
3769
3793
  startLogin() {
3770
3794
  const url = `https://${this.domain}/oauth2/authorize`;
3771
3795
  const params = new URLSearchParams();
3772
- params.append('identity_provider', this.identityProvider);
3796
+ params.append('identity_provider', this.identityProvider());
3773
3797
  params.append('redirect_uri', this.redirectURI);
3774
3798
  params.append('response_type', 'code');
3775
3799
  params.append('client_id', this.clientId);
@@ -3779,7 +3803,7 @@ class IDEAOktaPage {
3779
3803
  async endLogin() {
3780
3804
  const url = `https://${this.domain}/oauth2/token`;
3781
3805
  const params = new URLSearchParams();
3782
- params.append('code', this.code);
3806
+ params.append('code', this.code());
3783
3807
  params.append('grant_type', 'authorization_code');
3784
3808
  params.append('redirect_uri', this.redirectURI);
3785
3809
  params.append('client_id', this.clientId);
@@ -3793,7 +3817,7 @@ class IDEAOktaPage {
3793
3817
  }
3794
3818
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: IDEAOktaPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3795
3819
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.2", type: IDEAOktaPage, isStandalone: true, selector: "okta", ngImport: i0, template: `
3796
- @if (!code && !go) {
3820
+ @if (!code() && !go()) {
3797
3821
  <ion-content>
3798
3822
  <div class="flexBox">
3799
3823
  <ion-card class="authCard">
@@ -3807,7 +3831,7 @@ class IDEAOktaPage {
3807
3831
  </ion-card-header>
3808
3832
  }
3809
3833
  <ion-card-content>
3810
- @if (identityProvider) {
3834
+ @if (identityProvider()) {
3811
3835
  <ion-button expand="block" [title]="'IDEA_AUTH.SIGN_IN_HINT' | translate" (click)="startLogin()">
3812
3836
  {{ 'IDEA_AUTH.SIGN_IN' | translate }}
3813
3837
  </ion-button>
@@ -3826,7 +3850,7 @@ class IDEAOktaPage {
3826
3850
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: IDEAOktaPage, decorators: [{
3827
3851
  type: Component,
3828
3852
  args: [{ selector: 'okta', imports: [IDEATranslatePipe, IonContent, IonCard, IonImg, IonCardHeader, IonCardTitle, IonCardContent, IonButton], changeDetection: ChangeDetectionStrategy.OnPush, template: `
3829
- @if (!code && !go) {
3853
+ @if (!code() && !go()) {
3830
3854
  <ion-content>
3831
3855
  <div class="flexBox">
3832
3856
  <ion-card class="authCard">
@@ -3840,7 +3864,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
3840
3864
  </ion-card-header>
3841
3865
  }
3842
3866
  <ion-card-content>
3843
- @if (identityProvider) {
3867
+ @if (identityProvider()) {
3844
3868
  <ion-button expand="block" [title]="'IDEA_AUTH.SIGN_IN_HINT' | translate" (click)="startLogin()">
3845
3869
  {{ 'IDEA_AUTH.SIGN_IN' | translate }}
3846
3870
  </ion-button>