1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

[PM-9318] Fix username on protonpass import (#9889)

* Fix username field used for ProtonPass import

ProtonPass has changed their export format and userName is not itemEmail

* Import additional field itemUsername

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith
2024-07-08 22:45:02 +02:00
committed by GitHub
parent 6b122ca123
commit 83a32cd179
4 changed files with 14 additions and 7 deletions

View File

@@ -48,9 +48,10 @@ export class ProtonPassJsonImporter extends BaseImporter implements Importer {
case "login": {
const loginContent = item.data.content as ProtonPassLoginItemContent;
cipher.login.uris = this.makeUriArray(loginContent.urls);
cipher.login.username = this.getValueOrDefault(loginContent.username);
cipher.login.username = this.getValueOrDefault(loginContent.itemEmail);
cipher.login.password = this.getValueOrDefault(loginContent.password);
cipher.login.totp = this.getValueOrDefault(loginContent.totpUri);
this.processKvp(cipher, "itemUsername", loginContent.itemUsername);
for (const extraField of item.data.extraFields) {
this.processKvp(
cipher,

View File

@@ -56,10 +56,11 @@ export type ProtonPassItemExtraFieldData = {
};
export type ProtonPassLoginItemContent = {
username?: string;
itemEmail?: string;
password?: string;
urls?: string[];
totpUri?: string;
itemUsername?: string;
};
export type ProtonPassCreditCardItemContent = {