From 0fba5810d9476db97b11f2c72213e9acda72f1f7 Mon Sep 17 00:00:00 2001 From: Jake Fink Date: Mon, 8 Jan 2024 12:00:28 -0500 Subject: [PATCH] sync before migrating legacy user (#7435) --- .../migrate-encryption/migrate-legacy-encryption.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.component.ts b/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.component.ts index d76a3c2116..bcde8fb745 100644 --- a/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.component.ts +++ b/apps/web/src/app/auth/migrate-encryption/migrate-legacy-encryption.component.ts @@ -6,6 +6,7 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; +import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { SharedModule } from "../../shared"; import { UserKeyRotationModule } from "../key-rotation/user-key-rotation.module"; @@ -30,6 +31,7 @@ export class MigrateFromLegacyEncryptionComponent { private cryptoService: CryptoService, private messagingService: MessagingService, private logService: LogService, + private syncService: SyncService, ) {} submit = async () => { @@ -48,6 +50,8 @@ export class MigrateFromLegacyEncryptionComponent { const masterPassword = this.formGroup.value.masterPassword; try { + await this.syncService.fullSync(false, true); + await this.keyRotationService.rotateUserKeyAndEncryptedData(masterPassword); this.platformUtilsService.showToast(