forked from jsnbuchanan/crowd-funder-for-time-pwa
add page for one-on-one invites (incomplete)
This commit is contained in:
@@ -54,16 +54,22 @@ export function isFromPasskey(keyMeta?: KeyMeta): boolean {
|
||||
export async function createEndorserJwtForKey(
|
||||
account: KeyMeta,
|
||||
payload: object,
|
||||
expiresIn?: number,
|
||||
) {
|
||||
if (account?.identity) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const identity: IIdentifier = JSON.parse(account.identity!);
|
||||
const privateKeyHex = identity.keys[0].privateKeyHex;
|
||||
const signer = await SimpleSigner(privateKeyHex as string);
|
||||
return didJwt.createJWT(payload, {
|
||||
const options = {
|
||||
issuer: account.did,
|
||||
signer: signer,
|
||||
});
|
||||
expiresIn: undefined as number | undefined,
|
||||
}
|
||||
if (expiresIn) {
|
||||
options.expiresIn = expiresIn;
|
||||
}
|
||||
return didJwt.createJWT(payload, options);
|
||||
} else if (account?.passkeyCredIdHex) {
|
||||
return createDidPeerJwt(account.did, account.passkeyCredIdHex, payload);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user