forked from jsnbuchanan/crowd-funder-for-time-pwa
switch the encryption secret from localStorage to IndexedDB (because localStorage gets lost so often)
This commit is contained in:
@@ -9,7 +9,8 @@ import { Contact } from "@/db/tables/contacts";
|
||||
import { accessToken, deriveAddress, nextDerivationPath } from "@/libs/crypto";
|
||||
import { NonsensitiveDexie } from "@/db/index";
|
||||
import {
|
||||
getAccount,
|
||||
retrieveAccountMetadata,
|
||||
retrieveFullyDecryptedAccount,
|
||||
getPasskeyExpirationSeconds,
|
||||
GiverReceiverInputInfo,
|
||||
} from "@/libs/util";
|
||||
@@ -506,7 +507,7 @@ export async function getHeaders(did?: string) {
|
||||
};
|
||||
if (did) {
|
||||
let token;
|
||||
const account = await getAccount(did);
|
||||
const account = await retrieveAccountMetadata(did);
|
||||
if (account?.passkeyCredIdHex) {
|
||||
if (
|
||||
passkeyAccessToken &&
|
||||
@@ -1054,7 +1055,7 @@ export async function createEndorserJwtForDid(
|
||||
payload: object,
|
||||
expiresIn?: number,
|
||||
) {
|
||||
const account = await getAccount(issuerDid);
|
||||
const account = await retrieveFullyDecryptedAccount(issuerDid);
|
||||
return createEndorserJwtForKey(account as KeyMeta, payload, expiresIn);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user