add encryption & decryption for the sensitive identity & mnemonic in SQL DB

This commit is contained in:
2025-05-26 22:42:20 -06:00
parent 35f5df6b6b
commit 0bfc18c385
8 changed files with 105 additions and 48 deletions

View File

@@ -109,9 +109,10 @@ import { Component, Vue } from "vue-facing-decorator";
import { useClipboard } from "@vueuse/core";
import QuickNav from "../components/QuickNav.vue";
import { NotificationIface } from "../constants/app";
import { NotificationIface, USE_DEXIE_DB } from "../constants/app";
import { retrieveSettingsForActiveAccount } from "../db/index";
import { Account } from "../db/tables/accounts";
import * as databaseUtil from "../db/databaseUtil";
import {
retrieveAccountCount,
retrieveFullyDecryptedAccount,
@@ -131,8 +132,14 @@ export default class SeedBackupView extends Vue {
// 'created' hook runs when the Vue instance is first created
async created() {
try {
const settings = await retrieveSettingsForActiveAccount();
const activeDid = settings.activeDid || "";
let activeDid = "";
const settings = await databaseUtil.retrieveSettingsForActiveAccount();
activeDid = settings.activeDid || "";
if (USE_DEXIE_DB) {
const settings = await retrieveSettingsForActiveAccount();
activeDid = settings.activeDid || "";
}
this.numAccounts = await retrieveAccountCount();
this.activeAccount = await retrieveFullyDecryptedAccount(activeDid);