From 6ec22f95702050c12716f79c7d7454835f9b2807 Mon Sep 17 00:00:00 2001 From: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com> Date: Thu, 10 Aug 2023 16:18:00 -0400 Subject: [PATCH] DeviceTrustCryptoService - don't worry about checking if a device should establish trust or not if the user doesn't have trusted device encryption on (#6010) --- .../device-trust-crypto.service.implementation.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libs/common/src/auth/services/device-trust-crypto.service.implementation.ts b/libs/common/src/auth/services/device-trust-crypto.service.implementation.ts index e7e1349eae..7093deb143 100644 --- a/libs/common/src/auth/services/device-trust-crypto.service.implementation.ts +++ b/libs/common/src/auth/services/device-trust-crypto.service.implementation.ts @@ -46,6 +46,14 @@ export class DeviceTrustCryptoService implements DeviceTrustCryptoServiceAbstrac } async trustDeviceIfRequired(): Promise { + // This handles the case in which a user has selected to trust a device + // however, their org has turned off TDE after they've made their choice + // They should not see device trusted toast + const supportsDeviceTrust = await this.supportsDeviceTrust(); + if (!supportsDeviceTrust) { + return; + } + const shouldTrustDevice = await this.getShouldTrustDevice(); if (shouldTrustDevice) { await this.trustDevice();