forked from jsnbuchanan/crowd-funder-for-time-pwa
add link directly into contact page to add a new contact via "contactJwt" query parameter
This commit is contained in:
@@ -270,6 +270,14 @@ export interface ErrorResult extends ResultWithType {
|
||||
|
||||
export type CreateAndSubmitClaimResult = SuccessResult | ErrorResult;
|
||||
|
||||
export interface UserInfo {
|
||||
name: string;
|
||||
publicEncKey: string;
|
||||
registered: boolean;
|
||||
profileImageUrl?: string;
|
||||
nextPublicEncKeyHash?: string;
|
||||
}
|
||||
|
||||
// This is used to check for hidden info.
|
||||
// See https://github.com/trentlarson/endorser-ch/blob/0cb626f803028e7d9c67f095858a9fc8542e3dbd/server/api/services/util.js#L6
|
||||
const HIDDEN_DID = "did:none:HIDDEN";
|
||||
@@ -934,17 +942,12 @@ export async function generateEndorserJwtForAccount(
|
||||
isRegistered?: boolean,
|
||||
name?: string,
|
||||
profileImageUrl?: string,
|
||||
// note that including the next key pushes QR codes to the next resolution smaller
|
||||
includeNextKeyIfDerived?: boolean,
|
||||
) {
|
||||
const publicKeyHex = account.publicKeyHex;
|
||||
const publicEncKey = Buffer.from(publicKeyHex, "hex").toString("base64");
|
||||
|
||||
interface UserInfo {
|
||||
name: string;
|
||||
publicEncKey: string;
|
||||
registered: boolean;
|
||||
profileImageUrl?: string;
|
||||
nextPublicEncKeyHash?: string;
|
||||
}
|
||||
const contactInfo = {
|
||||
iat: Date.now(),
|
||||
iss: account.did,
|
||||
@@ -958,7 +961,7 @@ export async function generateEndorserJwtForAccount(
|
||||
contactInfo.own.profileImageUrl = profileImageUrl;
|
||||
}
|
||||
|
||||
if (account?.mnemonic && account?.derivationPath) {
|
||||
if (includeNextKeyIfDerived && account?.mnemonic && account?.derivationPath) {
|
||||
const newDerivPath = nextDerivationPath(account.derivationPath as string);
|
||||
const nextPublicHex = deriveAddress(
|
||||
account.mnemonic as string,
|
||||
|
||||
Reference in New Issue
Block a user