1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

refactor handleMigrateEncryptionKey()

This commit is contained in:
rr-bw
2024-09-10 12:37:22 -07:00
parent b997b6024e
commit 40e2cb5747
4 changed files with 12 additions and 29 deletions

View File

@@ -169,8 +169,18 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
if (this.handleCaptchaRequired(authResult)) {
return;
} else if (await this.loginService.handleMigrateEncryptionKey(authResult)) {
return;
} else if (authResult.requiresEncryptionKeyMigration) {
/* Legacy accounts used the master key to encrypt data.
Migration is required but only performed on Web. */
if (this.clientType === ClientType.Web) {
await this.router.navigate(["migrate-legacy-encryption"]);
} else {
this.toastService.showToast({
variant: "error",
title: this.i18nService.t("errorOccured"),
message: this.i18nService.t("encryptionKeyMigrationRequired"),
});
}
} else if (authResult.requiresTwoFactor) {
await this.router.navigate(["2fa"]);
} else if (authResult.forcePasswordReset != ForceSetPasswordReason.None) {