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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user