Browse Source

Look in .own.did for DID, as well

pull/135/head
Jose Olarte III 1 week ago
parent
commit
cbc14e21ec
  1. 7
      src/views/ContactQRScanFullView.vue
  2. 7
      src/views/ContactQRScanShowView.vue

7
src/views/ContactQRScanFullView.vue

@ -357,8 +357,9 @@ export default class ContactQRScan extends Vue {
} }
const contactInfo = decodedJwt.payload.own; const contactInfo = decodedJwt.payload.own;
if (!decodedJwt.payload.iss) { const did = contactInfo.did || decodedJwt.payload.iss;
logger.warn("Invalid JWT payload - missing 'iss' field"); if (!did) {
logger.warn("Invalid contact info - missing DID");
this.$notify({ this.$notify({
group: "alert", group: "alert",
type: "danger", type: "danger",
@ -370,7 +371,7 @@ export default class ContactQRScan extends Vue {
// Create contact object // Create contact object
const contact = { const contact = {
did: decodedJwt.payload.iss, did: did,
name: contactInfo.name || "", name: contactInfo.name || "",
email: contactInfo.email || "", email: contactInfo.email || "",
phone: contactInfo.phone || "", phone: contactInfo.phone || "",

7
src/views/ContactQRScanShowView.vue

@ -483,8 +483,9 @@ export default class ContactQRScanShow extends Vue {
} }
const contactInfo = decodedJwt.payload.own; const contactInfo = decodedJwt.payload.own;
if (!decodedJwt.payload.iss) { const did = contactInfo.did || decodedJwt.payload.iss;
logger.warn("Invalid JWT payload - missing 'iss' field"); if (!did) {
logger.warn("Invalid contact info - missing DID");
this.$notify({ this.$notify({
group: "alert", group: "alert",
type: "danger", type: "danger",
@ -496,7 +497,7 @@ export default class ContactQRScanShow extends Vue {
// Create contact object // Create contact object
const contact = { const contact = {
did: decodedJwt.payload.iss, did: did,
name: contactInfo.name || "", name: contactInfo.name || "",
email: contactInfo.email || "", email: contactInfo.email || "",
phone: contactInfo.phone || "", phone: contactInfo.phone || "",

Loading…
Cancel
Save