forked from trent_larson/crowd-funder-for-time-pwa
Fixes for APP_SERVER definition issue
This commit is contained in:
@@ -4,7 +4,11 @@ import { sha256 } from "ethereum-cryptography/sha256";
|
|||||||
import { LRUCache } from "lru-cache";
|
import { LRUCache } from "lru-cache";
|
||||||
import * as R from "ramda";
|
import * as R from "ramda";
|
||||||
|
|
||||||
import { DEFAULT_IMAGE_API_SERVER, NotificationIface } from "../constants/app";
|
import {
|
||||||
|
DEFAULT_IMAGE_API_SERVER,
|
||||||
|
NotificationIface,
|
||||||
|
APP_SERVER,
|
||||||
|
} from "../constants/app";
|
||||||
import { Contact } from "../db/tables/contacts";
|
import { Contact } from "../db/tables/contacts";
|
||||||
import { accessToken, deriveAddress, nextDerivationPath } from "../libs/crypto";
|
import { accessToken, deriveAddress, nextDerivationPath } from "../libs/crypto";
|
||||||
import { logConsoleAndDb, NonsensitiveDexie } from "../db/index";
|
import { logConsoleAndDb, NonsensitiveDexie } from "../db/index";
|
||||||
@@ -16,7 +20,6 @@ import {
|
|||||||
GiverReceiverInputInfo,
|
GiverReceiverInputInfo,
|
||||||
} from "../libs/util";
|
} from "../libs/util";
|
||||||
import { createEndorserJwtForKey, KeyMeta } from "../libs/crypto/vc";
|
import { createEndorserJwtForKey, KeyMeta } from "../libs/crypto/vc";
|
||||||
import { Account } from "../db/tables/accounts";
|
|
||||||
|
|
||||||
export const SCHEMA_ORG_CONTEXT = "https://schema.org";
|
export const SCHEMA_ORG_CONTEXT = "https://schema.org";
|
||||||
// the object in RegisterAction claims
|
// the object in RegisterAction claims
|
||||||
@@ -1110,12 +1113,11 @@ export async function createAndSubmitClaim(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function generateEndorserJwtUrlForAccount(
|
export async function generateEndorserJwtUrlForAccount(
|
||||||
account: Account,
|
account: KeyMeta,
|
||||||
isRegistered?: boolean,
|
isRegistered: boolean,
|
||||||
name?: string,
|
givenName: string,
|
||||||
profileImageUrl?: string,
|
profileImageUrl: string,
|
||||||
// note that including the next key pushes QR codes to the next resolution smaller
|
isContact: boolean,
|
||||||
includeNextKeyIfDerived?: boolean,
|
|
||||||
) {
|
) {
|
||||||
const publicKeyHex = account.publicKeyHex;
|
const publicKeyHex = account.publicKeyHex;
|
||||||
const publicEncKey = Buffer.from(publicKeyHex, "hex").toString("base64");
|
const publicEncKey = Buffer.from(publicKeyHex, "hex").toString("base64");
|
||||||
@@ -1125,7 +1127,7 @@ export async function generateEndorserJwtUrlForAccount(
|
|||||||
iss: account.did,
|
iss: account.did,
|
||||||
own: {
|
own: {
|
||||||
did: account.did,
|
did: account.did,
|
||||||
name: name ?? "",
|
name: givenName ?? "",
|
||||||
publicEncKey,
|
publicEncKey,
|
||||||
registered: !!isRegistered,
|
registered: !!isRegistered,
|
||||||
} as UserInfo,
|
} as UserInfo,
|
||||||
@@ -1135,7 +1137,7 @@ export async function generateEndorserJwtUrlForAccount(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the next key -- not recommended for the QR code for such a high resolution
|
// Add the next key -- not recommended for the QR code for such a high resolution
|
||||||
if (includeNextKeyIfDerived && account?.mnemonic && account?.derivationPath) {
|
if (isContact && account?.mnemonic && account?.derivationPath) {
|
||||||
const newDerivPath = nextDerivationPath(account.derivationPath as string);
|
const newDerivPath = nextDerivationPath(account.derivationPath as string);
|
||||||
const nextPublicHex = deriveAddress(
|
const nextPublicHex = deriveAddress(
|
||||||
account.mnemonic as string,
|
account.mnemonic as string,
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ import { Router } from "vue-router";
|
|||||||
import { useClipboard } from "@vueuse/core";
|
import { useClipboard } from "@vueuse/core";
|
||||||
import QuickNav from "../components/QuickNav.vue";
|
import QuickNav from "../components/QuickNav.vue";
|
||||||
import TopMessage from "../components/TopMessage.vue";
|
import TopMessage from "../components/TopMessage.vue";
|
||||||
import { NotificationIface } from "../constants/app";
|
import { NotificationIface, APP_SERVER } from "../constants/app";
|
||||||
import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
||||||
import { retrieveAccountMetadata } from "../libs/util";
|
import { retrieveAccountMetadata } from "../libs/util";
|
||||||
import { generateEndorserJwtUrlForAccount } from "../libs/endorserServer";
|
import { generateEndorserJwtUrlForAccount } from "../libs/endorserServer";
|
||||||
@@ -57,6 +57,10 @@ import { generateEndorserJwtUrlForAccount } from "../libs/endorserServer";
|
|||||||
export default class ShareMyContactInfoView extends Vue {
|
export default class ShareMyContactInfoView extends Vue {
|
||||||
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
$notify!: (notification: NotificationIface, timeout?: number) => void;
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
console.log("APP_SERVER in mounted:", APP_SERVER);
|
||||||
|
}
|
||||||
|
|
||||||
async onClickShare() {
|
async onClickShare() {
|
||||||
const settings = await retrieveSettingsForActiveAccount();
|
const settings = await retrieveSettingsForActiveAccount();
|
||||||
const activeDid = settings.activeDid || "";
|
const activeDid = settings.activeDid || "";
|
||||||
|
|||||||
Reference in New Issue
Block a user