@pushary/agent-hooks 0.83.0 → 0.83.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -691,10 +691,15 @@ var buildPairLinks = (pairId, publicKeyB64, baseUrl = apiBase(), code = null) =>
|
|
|
691
691
|
const id = encodeURIComponent(pairId);
|
|
692
692
|
const pk = encodeURIComponent(publicKeyB64);
|
|
693
693
|
const origin = baseUrl.replace(/\/+$/, "");
|
|
694
|
+
const longLink = `${origin}/pair?id=${id}&pk=${pk}`;
|
|
694
695
|
return {
|
|
695
|
-
//
|
|
696
|
-
//
|
|
697
|
-
|
|
696
|
+
// Never shortened. Both scanners have to read this one: the phone camera,
|
|
697
|
+
// which opens it, and the app's own scanner, which parses id and pk straight
|
|
698
|
+
// off it and cannot resolve a code. 22 rows of QR instead of 16 is the price
|
|
699
|
+
// of the in-app scan button working at all.
|
|
700
|
+
qrLink: longLink,
|
|
701
|
+
// 33 characters against 114, for the person reading it off the screen.
|
|
702
|
+
universalLink: code ? `${origin}/pair/${encodeURIComponent(code)}` : longLink,
|
|
698
703
|
// Never shortened: the scheme reaches an installed app with no server round
|
|
699
704
|
// trip, which is the path that has to survive the short code failing.
|
|
700
705
|
deepLink: `pushary://pair?pk=${pk}&id=${id}`
|
|
@@ -708,11 +713,11 @@ var connectViaAppPairing = async (options = {}) => {
|
|
|
708
713
|
return null;
|
|
709
714
|
}
|
|
710
715
|
const { pairId, code } = started;
|
|
711
|
-
const { universalLink, deepLink } = buildPairLinks(pairId, keypair.publicKeyB64, apiBase(), code);
|
|
716
|
+
const { qrLink, universalLink, deepLink } = buildPairLinks(pairId, keypair.publicKeyB64, apiBase(), code);
|
|
712
717
|
console.log();
|
|
713
718
|
console.log(` ${bold("Connect your Pushary app")}`);
|
|
714
719
|
console.log(` ${dim("Scan this with your phone camera:")}`);
|
|
715
|
-
await printQr(
|
|
720
|
+
await printQr(qrLink);
|
|
716
721
|
console.log(` ${dim("No camera handy? Open this on the phone instead:")}`);
|
|
717
722
|
console.log(` ${cyan(universalLink)}`);
|
|
718
723
|
console.log(` ${dim("Confirm the app shows fingerprint")} ${cyan(publicKeyFingerprint(keypair.publicKeyB64))}`);
|