Skip to content

Commit

Permalink
PM-3169 - Add some additional context to new redirect guard scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredSnider-Bitwarden committed Aug 2, 2023
1 parent 32f0201 commit 62a0b5e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/angular/src/auth/guards/redirect.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export function redirectGuard(overrides: Partial<RedirectRoutes> = {}): CanActiv
return router.createUrlTree([routes.loggedIn], { queryParams: route.queryParams });
}

// If TDE is enabled and the user hasn't decrypted yet, then redirect to the
// login decryption options component. This is especially useful for the
// Browser Post SSO open popup flow where the user is AuthN and should see
// decryption options and not the lock screen.
const tdeEnabled = await deviceTrustCryptoService.supportsDeviceTrust();
const everHadUserKey = await cryptoService.getEverHadUserKey();
if (authStatus === AuthenticationStatus.Locked && tdeEnabled && !everHadUserKey) {
Expand Down

0 comments on commit 62a0b5e

Please sign in to comment.