switch the encryption secret from localStorage to IndexedDB (because localStorage gets lost so often)

This commit is contained in:
2024-12-08 19:34:31 -07:00
parent ed4a9e581b
commit 251649e6fe
35 changed files with 295 additions and 255 deletions

View File

@@ -388,7 +388,6 @@ import {
PASSKEYS_ENABLED,
} from "@/constants/app";
import {
accountsDB,
db,
retrieveSettingsForActiveAccount,
updateAccountSettings,
@@ -412,6 +411,7 @@ import {
} from "@/libs/endorserServer";
import {
generateSaveAndActivateIdentity,
retrieveAccountDids,
GiverReceiverInputInfo,
OnboardPage,
registerSaveAndActivatePasskey,
@@ -486,11 +486,8 @@ export default class HomeView extends Vue {
async mounted() {
try {
await accountsDB.open();
const allAccounts = await accountsDB.accounts.toArray();
if (allAccounts.length > 0) {
this.allMyDids = allAccounts.map((acc) => acc.did);
} else {
this.allMyDids = await retrieveAccountDids();
if (this.allMyDids.length === 0) {
this.isCreatingIdentifier = true;
const newDid = await generateSaveAndActivateIdentity();
this.isCreatingIdentifier = false;