mirror of
https://github.com/temetro/temetro.git
synced 2026-08-30 20:39:06 +00:00
fix: use phone-reachable relay URL in wallet-import QR
The "Import from a patient app → QR" code baked the web app's own API_BASE_URL (typically http://localhost:4000) into the pairing URI, so a real phone could never reach the relay and "Scan to connect" silently stalled. Use the backend's server-resolved, device-reachable relay URL instead (PUBLIC_RELAY_URL, else the request host), surface it on the WalletPairing type, and document PUBLIC_RELAY_URL in .env.example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -216,7 +216,13 @@ export async function requestWalletShare(input: {
|
||||
// Create a QR pairing request (no wallet number — the patient scans a QR that
|
||||
// carries this clinic's relay URL + the request). Returns the request plus the
|
||||
// ephemeral public key the device seals to.
|
||||
export type WalletPairing = WalletShareRequest & { ephemeralPubKey: string };
|
||||
export type WalletPairing = WalletShareRequest & {
|
||||
ephemeralPubKey: string;
|
||||
// A phone-reachable relay URL the device should connect to (resolved
|
||||
// server-side from PUBLIC_RELAY_URL / the request host — not necessarily this
|
||||
// browser's API_BASE_URL, which may be localhost).
|
||||
relayUrl: string;
|
||||
};
|
||||
|
||||
export async function requestWalletPairing(input: {
|
||||
mode: WalletShareMode;
|
||||
|
||||
Reference in New Issue
Block a user