fix(export): harden config export passphrase handling
This commit is contained in:
1 parent
d8ec9bb8d0
commit
99a9961712
7 files changed
+202
-10
No files matched your search
@@ -2,6 +2,7 @@ import { ref, watch } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useConnectionStore } from "@/stores/connectionStore";
|
||||
import { useToast } from "@/composables/useToast";
|
||||
import { rememberExportPassphrase } from "@/lib/backend/exportPassphraseSession";
|
||||
import { hasSidebarLayoutEntries } from "@/lib/sidebar/sidebarLayout";
|
||||
import type { ConnectionConfigBundle } from "@/lib/connection/connectionConfigTransfer";
|
||||
import type { ConnectionConfig, SidebarLayout } from "@/types/database";
|
||||
@@ -337,6 +338,8 @@ export function useDialogSources() {
|
||||
try {
|
||||
const result = await connectionStore.exportConnectionsToFile({ mode: "encrypted", passphrase }, pendingExportConnectionIds.value);
|
||||
if (result === "cancelled") return;
|
||||
// 仅在文件写入成功后才记住密码短语,供同一会话内下次导出对话框回显(仅内存,不落盘)
|
||||
rememberExportPassphrase(passphrase);
|
||||
showConfigPassphraseDialog.value = false;
|
||||
clearPendingExportState();
|
||||
toast(t("configExport.exportSuccess"), 2000);
|
||||
|
||||
Reference in new issue
Block a user