1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +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

@@ -1,6 +1,5 @@
import { UrlTree } from "@angular/router";
import { AuthResult } from "@bitwarden/common/auth/models/domain/auth-result";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { ToastService } from "@bitwarden/components";
@@ -23,18 +22,4 @@ export class DefaultLoginService implements LoginService {
async getOrgPolicies(): Promise<PasswordPolicies | null> {
return null;
}
// Legacy accounts used the master key to encrypt data. Migration is required but only performed on web
async handleMigrateEncryptionKey(result: AuthResult): Promise<boolean> {
if (!result.requiresEncryptionKeyMigration) {
return false;
}
this.toastService.showToast({
variant: "error",
title: this.i18nService.t("errorOccured"),
message: this.i18nService.t("encryptionKeyMigrationRequired"),
});
return true;
}
}