mirror of
https://github.com/temetro/temetro.git
synced 2026-09-04 06:45:26 +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:
@@ -19,7 +19,7 @@ import {
|
||||
} from "@/components/ui/dialog";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { ApiError, API_BASE_URL } from "@/lib/api-client";
|
||||
import { ApiError } from "@/lib/api-client";
|
||||
import {
|
||||
commitWalletShare,
|
||||
type Patient,
|
||||
@@ -159,7 +159,10 @@ export function ImportFromWalletDialog({
|
||||
durationHours: temporary ? durationHours : undefined,
|
||||
});
|
||||
const params = new URLSearchParams({
|
||||
relay: API_BASE_URL,
|
||||
// Use the server-resolved, phone-reachable relay URL — NOT API_BASE_URL,
|
||||
// which is often http://localhost:4000 (the phone itself) and never
|
||||
// connects from a real device.
|
||||
relay: pairing.relayUrl,
|
||||
rid: pairing.id,
|
||||
epk: pairing.ephemeralPubKey,
|
||||
mode: pairing.shareMode,
|
||||
|
||||
Reference in New Issue
Block a user