mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-31 22:51:28 +01:00
1password1pux importer can import json (#6049)
The .1pux-format is technically just a ziup-file that contain a file named `export.data`which is a json file. These changes add support to upload either a 1pux or the export.data file directly. The thought to change this came through the recent addtion of the ProtonPass importer. Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
parent
d21cc261e6
commit
98cfe1b806
@ -66,7 +66,7 @@ export class ImportCommand {
|
||||
|
||||
try {
|
||||
let contents;
|
||||
if (format === "1password1pux") {
|
||||
if (format === "1password1pux" && filepath.endsWith(".1pux")) {
|
||||
contents = await CliUtils.extractZipContent(filepath, "export.data");
|
||||
} else if (format === "protonpass" && filepath.endsWith(".zip")) {
|
||||
contents = await CliUtils.extractZipContent(filepath, "Proton Pass/data.json");
|
||||
|
@ -309,7 +309,7 @@ export class ImportComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private getFileContents(file: File): Promise<string> {
|
||||
if (this.format === "1password1pux") {
|
||||
if (this.format === "1password1pux" && file.name.endsWith(".1pux")) {
|
||||
return this.extractZipContent(file, "export.data");
|
||||
}
|
||||
if (
|
||||
|
@ -12,7 +12,7 @@ export const featuredImportOptions = [
|
||||
{ id: "keepass2xml", name: "KeePass 2 (xml)" },
|
||||
{ id: "lastpasscsv", name: "LastPass (csv)" },
|
||||
{ id: "safaricsv", name: "Safari and macOS (csv)" },
|
||||
{ id: "1password1pux", name: "1Password (1pux)" },
|
||||
{ id: "1password1pux", name: "1Password (1pux/json)" },
|
||||
] as const;
|
||||
|
||||
export const regularImportOptions = [
|
||||
|
Loading…
Reference in New Issue
Block a user