1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 11:13:46 +00:00

[PM-27656] Show error message when detecting Chromium v3 encryption, which isn't supported yet (#17156)

* Replace any-returns with types

* Show an error message when a failure from the native call is returned

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
This commit is contained in:
Daniel James Smith
2025-11-06 20:53:13 +01:00
committed by GitHub
parent 1be9e19fad
commit 3c2f44095a
3 changed files with 40 additions and 5 deletions

View File

@@ -38,6 +38,23 @@ import { ImportType } from "../../models";
type ProfileOption = { id: string; name: string };
type Login = {
url: string;
username: string;
password: string;
note: string;
};
type LoginImportFailure = {
url: string;
username: string;
error: string;
};
type LoginImportResult = {
login?: Login;
failure?: LoginImportFailure;
};
// FIXME(https://bitwarden.atlassian.net/browse/CL-764): Migrate to OnPush
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
@Component({
@@ -82,7 +99,7 @@ export class ImportChromeComponent implements OnInit, OnDestroy {
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-signals
@Input()
onImportFromBrowser: (browser: string, profile: string) => Promise<any[]>;
onImportFromBrowser: (browser: string, profile: string) => Promise<LoginImportResult[]>;
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
// eslint-disable-next-line @angular-eslint/prefer-output-emitter-ref
@@ -121,6 +138,17 @@ export class ImportChromeComponent implements OnInit, OnDestroy {
this.getBrowserName(this.format()),
this.formGroup.controls.profile.value,
);
// If any of the login items has a failure return a generic error message
// Introduced because we ran into a new type of V3 encryption added on Chrome that we don't yet support
if (logins.some((l) => l.failure != null)) {
return {
errors: {
message: this.i18nService.t("errorOccurred"),
},
};
}
if (logins.length === 0) {
return {
errors: {