1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PS-2263] Keeper CSV import: import TOTP to correct field (#4478)

* Keeper CSV import: import TOTP to correct field

* Fix small issue with notes import

Notes field can be null, the ` + "\n"` coerces those to `"null"`.

* Adds unit tests
This commit is contained in:
Hermann Käser
2023-01-18 04:19:46 -05:00
committed by GitHub
parent f82a9f33bd
commit a6308042b6
3 changed files with 92 additions and 2 deletions

View File

@@ -18,7 +18,12 @@ export class KeeperCsvImporter extends BaseImporter implements Importer {
this.processFolder(result, value[0]);
const cipher = this.initLoginCipher();
cipher.notes = this.getValueOrDefault(value[5]) + "\n";
const notes = this.getValueOrDefault(value[5]);
if (notes) {
cipher.notes = `${notes}\n`;
}
cipher.name = this.getValueOrDefault(value[1], "--");
cipher.login.username = this.getValueOrDefault(value[2]);
cipher.login.password = this.getValueOrDefault(value[3]);
@@ -27,7 +32,11 @@ export class KeeperCsvImporter extends BaseImporter implements Importer {
if (value.length > 7) {
// we have some custom fields.
for (let i = 7; i < value.length; i = i + 2) {
this.processKvp(cipher, value[i], value[i + 1]);
if (value[i] == "TFC:Keeper") {
cipher.login.totp = value[i + 1];
} else {
this.processKvp(cipher, value[i], value[i + 1]);
}
}
}