1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-13 14:53:33 +00:00

[PM-4077] safeincloud multiple url fix (#6394)

* safeincloud multiple url fix
* Ensure LoginView.uris is consistently populated
This commit is contained in:
bharat
2023-12-14 22:10:51 +05:30
committed by GitHub
parent 00fd45a678
commit 96d1c83385
2 changed files with 4 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ export class LoginView extends ItemView {
passwordRevisionDate?: Date = null; passwordRevisionDate?: Date = null;
totp: string = null; totp: string = null;
uris: LoginUriView[] = null; uris: LoginUriView[] = [];
autofillOnPageLoad: boolean = null; autofillOnPageLoad: boolean = null;
fido2Credentials: Fido2CredentialView[] = null; fido2Credentials: Fido2CredentialView[] = null;
@@ -62,7 +62,7 @@ export class LoginView extends ItemView {
} }
get hasUris(): boolean { get hasUris(): boolean {
return this.uris != null && this.uris.length > 0; return this.uris.length > 0;
} }
get hasFido2Credentials(): boolean { get hasFido2Credentials(): boolean {
@@ -84,7 +84,7 @@ export class LoginView extends ItemView {
static fromJSON(obj: Partial<Jsonify<LoginView>>): LoginView { static fromJSON(obj: Partial<Jsonify<LoginView>>): LoginView {
const passwordRevisionDate = const passwordRevisionDate =
obj.passwordRevisionDate == null ? null : new Date(obj.passwordRevisionDate); obj.passwordRevisionDate == null ? null : new Date(obj.passwordRevisionDate);
const uris = obj.uris?.map((uri: any) => LoginUriView.fromJSON(uri)); const uris = obj.uris.map((uri: any) => LoginUriView.fromJSON(uri));
const fido2Credentials = obj.fido2Credentials?.map((key) => Fido2CredentialView.fromJSON(key)); const fido2Credentials = obj.fido2Credentials?.map((key) => Fido2CredentialView.fromJSON(key));
return Object.assign(new LoginView(), obj, { return Object.assign(new LoginView(), obj, {

View File

@@ -81,7 +81,7 @@ export class SafeInCloudXmlImporter extends BaseImporter implements Importer {
} else if (fieldType === "notes") { } else if (fieldType === "notes") {
cipher.notes += text + "\n"; cipher.notes += text + "\n";
} else if (fieldType === "weblogin" || fieldType === "website") { } else if (fieldType === "weblogin" || fieldType === "website") {
cipher.login.uris = this.makeUriArray(text); cipher.login.uris.push(...this.makeUriArray(text));
} else { } else {
this.processKvp(cipher, name, text); this.processKvp(cipher, name, text);
} }