1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 00:03:56 +00:00

[Beeep] [PM-10767] Improve username importing on protonpass importer (#10471)

* Improve username importing on protonpass importer

* Conditionally write proton importer custom fields
This commit is contained in:
Bernd Schoolmann
2024-08-12 20:42:04 +02:00
committed by GitHub
parent a7adf952db
commit 6bc0ffc930
3 changed files with 13 additions and 6 deletions

View File

@@ -48,10 +48,17 @@ 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.itemEmail);
cipher.login.username = this.getValueOrDefault(loginContent.itemUsername);
// if the cipher has no username then the email is used as the username
if (cipher.login.username == null) {
cipher.login.username = this.getValueOrDefault(loginContent.itemEmail);
} else {
this.processKvp(cipher, "email", 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,