[SG-659] Classic 2019 plans no longer generating TOTP codes for Free users (#3509)
* [SG-659] Fixed TOTP code visibility for users with classic plans. * [SG-659] Refactored condition. * [SG-659] Ran prettier * [SG-659] Simplified expression.
This commit is contained in:
parent
a4ef63da37
commit
acf332b689
|
@ -139,7 +139,7 @@
|
||||||
<div
|
<div
|
||||||
class="box-content-row box-content-row-flex totp"
|
class="box-content-row box-content-row-flex totp"
|
||||||
[ngClass]="{ low: totpLow }"
|
[ngClass]="{ low: totpLow }"
|
||||||
*ngIf="cipher.login.totp && totpCode && canAccessPremium"
|
*ngIf="cipher.login.totp && totpCode"
|
||||||
>
|
>
|
||||||
<div class="row-main">
|
<div class="row-main">
|
||||||
<span
|
<span
|
||||||
|
@ -178,10 +178,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div class="box-content-row box-content-row-flex totp" *ngIf="showPremiumRequiredTotp">
|
||||||
class="box-content-row box-content-row-flex totp"
|
|
||||||
*ngIf="cipher.login.totp && !canAccessPremium"
|
|
||||||
>
|
|
||||||
<div class="row-main">
|
<div class="row-main">
|
||||||
<span class="row-label">{{ "verificationCodeTotp" | i18n }}</span>
|
<span class="row-label">{{ "verificationCodeTotp" | i18n }}</span>
|
||||||
<span class="row-label">
|
<span class="row-label">
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
<div
|
<div
|
||||||
class="box-content-row box-content-row-flex totp"
|
class="box-content-row box-content-row-flex totp"
|
||||||
[ngClass]="{ low: totpLow }"
|
[ngClass]="{ low: totpLow }"
|
||||||
*ngIf="cipher.login.totp && totpCode && canAccessPremium"
|
*ngIf="cipher.login.totp && totpCode"
|
||||||
>
|
>
|
||||||
<div class="row-main">
|
<div class="row-main">
|
||||||
<span
|
<span
|
||||||
|
@ -138,10 +138,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="box-content-row box-content-row-flex totp" *ngIf="showPremiumRequiredTotp">
|
||||||
class="box-content-row box-content-row-flex totp"
|
|
||||||
*ngIf="cipher.login.totp && !canAccessPremium"
|
|
||||||
>
|
|
||||||
<div class="row-main">
|
<div class="row-main">
|
||||||
<span class="row-label">{{ "verificationCodeTotp" | i18n }}</span>
|
<span class="row-label">{{ "verificationCodeTotp" | i18n }}</span>
|
||||||
<span class="row-label">
|
<span class="row-label">
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
<div class="tw-mb-4 tw-ml-4 tw-flex tw-w-1/2 tw-items-end" [ngClass]="{ low: totpLow }">
|
<div class="tw-mb-4 tw-ml-4 tw-flex tw-w-1/2 tw-items-end" [ngClass]="{ low: totpLow }">
|
||||||
<div
|
<div
|
||||||
class="totp tw-flex tw-flex-row tw-items-center"
|
class="totp tw-flex tw-flex-row tw-items-center"
|
||||||
*ngIf="!cipher.login.totp || (cipher.login.totp && !canAccessPremium)"
|
*ngIf="!cipher.login.totp || !totpCode"
|
||||||
>
|
>
|
||||||
<span class="totp-countdown">
|
<span class="totp-countdown">
|
||||||
<span class="totp-sec tw-text-muted">15</span>
|
<span class="totp-sec tw-text-muted">15</span>
|
||||||
|
@ -237,7 +237,7 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
*ngIf="cipher.login.totp && totpCode && canAccessPremium"
|
*ngIf="cipher.login.totp && totpCode"
|
||||||
class="totp tw-flex tw-flex-row tw-items-center"
|
class="totp tw-flex tw-flex-row tw-items-center"
|
||||||
>
|
>
|
||||||
<span class="totp-countdown">
|
<span class="totp-countdown">
|
||||||
|
|
|
@ -50,6 +50,7 @@ export class ViewComponent implements OnDestroy, OnInit {
|
||||||
showCardNumber: boolean;
|
showCardNumber: boolean;
|
||||||
showCardCode: boolean;
|
showCardCode: boolean;
|
||||||
canAccessPremium: boolean;
|
canAccessPremium: boolean;
|
||||||
|
showPremiumRequiredTotp: boolean;
|
||||||
totpCode: string;
|
totpCode: string;
|
||||||
totpCodeFormatted: string;
|
totpCodeFormatted: string;
|
||||||
totpDash: number;
|
totpDash: number;
|
||||||
|
@ -108,6 +109,8 @@ export class ViewComponent implements OnDestroy, OnInit {
|
||||||
const cipher = await this.cipherService.get(this.cipherId);
|
const cipher = await this.cipherService.get(this.cipherId);
|
||||||
this.cipher = await cipher.decrypt();
|
this.cipher = await cipher.decrypt();
|
||||||
this.canAccessPremium = await this.stateService.getCanAccessPremium();
|
this.canAccessPremium = await this.stateService.getCanAccessPremium();
|
||||||
|
this.showPremiumRequiredTotp =
|
||||||
|
this.cipher.login.totp && !this.canAccessPremium && !this.cipher.organizationUseTotp;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.cipher.type === CipherType.Login &&
|
this.cipher.type === CipherType.Login &&
|
||||||
|
|
Loading…
Reference in New Issue