move legacy check below auth check in lock guard (#6696)

This commit is contained in:
Jake Fink 2023-10-25 13:02:20 -04:00 committed by GitHub
parent 70f2805ccc
commit 8dd17bd55a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -33,6 +33,11 @@ export function lockGuard(): CanActivateFn {
const router = inject(Router);
const userVerificationService = inject(UserVerificationService);
const authStatus = await authService.getAuthStatus();
if (authStatus !== AuthenticationStatus.Locked) {
return router.createUrlTree(["/"]);
}
// If legacy user on web, redirect to migration page
if (await cryptoService.isLegacyUser()) {
if (platformUtilService.getClientType() === ClientType.Web) {
@ -43,11 +48,6 @@ export function lockGuard(): CanActivateFn {
return false;
}
const authStatus = await authService.getAuthStatus();
if (authStatus !== AuthenticationStatus.Locked) {
return router.createUrlTree(["/"]);
}
// User is authN and in locked state.
const tdeEnabled = await deviceTrustCryptoService.supportsDeviceTrust();