forked from jsnbuchanan/crowd-funder-for-time-pwa
switch so personal contact JWT is link to this server (not endorser.ch), make empty-did URL show user's info
This commit is contained in:
@@ -93,17 +93,18 @@ import { AxiosError } from "axios";
|
||||
import QRCodeVue3 from "qr-code-generator-vue3";
|
||||
import { Component, Vue } from "vue-facing-decorator";
|
||||
import { QrcodeStream } from "vue-qrcode-reader";
|
||||
import { Router } from "vue-router";
|
||||
import { useClipboard } from "@vueuse/core";
|
||||
|
||||
import QuickNav from "@/components/QuickNav.vue";
|
||||
import UserNameDialog from "@/components/UserNameDialog.vue";
|
||||
import { NotificationIface } from "@/constants/app";
|
||||
import { APP_SERVER, NotificationIface } from "@/constants/app";
|
||||
import { db, retrieveSettingsForActiveAccount } from "@/db/index";
|
||||
import { Contact } from "@/db/tables/contacts";
|
||||
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||
import { getContactPayloadFromJwtUrl } from "@/libs/crypto";
|
||||
import {
|
||||
generateEndorserJwtForAccount,
|
||||
generateEndorserJwtUrlForAccount,
|
||||
isDid,
|
||||
register,
|
||||
setVisibilityUtil,
|
||||
@@ -146,7 +147,7 @@ export default class ContactQRScanShow extends Vue {
|
||||
(settings.firstName || "") +
|
||||
(settings.lastName ? ` ${settings.lastName}` : ""); // lastName is deprecated, pre v 0.1.3
|
||||
|
||||
this.qrValue = await generateEndorserJwtForAccount(
|
||||
this.qrValue = await generateEndorserJwtUrlForAccount(
|
||||
account,
|
||||
!!settings.isRegistered,
|
||||
name,
|
||||
@@ -192,6 +193,13 @@ export default class ContactQRScanShow extends Vue {
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(payload.contacts)) {
|
||||
// reroute to the ContactsImport
|
||||
(this.$router as Router).push({
|
||||
path: '/contacts-import/' + url.substring(url.lastIndexOf('/') + 1),
|
||||
});
|
||||
return;
|
||||
}
|
||||
newContact = {
|
||||
did: payload.iss as string,
|
||||
name: payload.own.name,
|
||||
@@ -405,7 +413,7 @@ export default class ContactQRScanShow extends Vue {
|
||||
useClipboard()
|
||||
.copy(this.qrValue)
|
||||
.then(() => {
|
||||
console.log("Contact URL:", this.qrValue);
|
||||
// console.log("Contact URL:", this.qrValue);
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
|
||||
Reference in New Issue
Block a user