headscale: share the invite's https link, drop the deep link

This commit is contained in:
2026-08-06 00:48:45 +00:00
parent 91ed90893d
commit 5f6377ac33
2 changed files with 18 additions and 7 deletions
@@ -80,13 +80,12 @@ type InviteLinkPanelProps = { invite: HeadscaleInviteCreated; onDismiss: () => v
const InviteLinkPanel = ({ invite, onDismiss }: InviteLinkPanelProps) => {
const [showQr, setShowQr] = useState(true);
// The link goes in `text`, not `url`: it is a custom scheme (`officer-offscale://join#…`) and several
// share-sheet implementations only accept http(s) in the url field, rejecting the whole call. As text it
// is passed through verbatim by every messenger. A cancelled sheet rejects too — nothing to report there,
// the link is still on screen.
// Plain https now — the link lands on a page the companion serves, which bounces into the app. It goes in
// `url` rather than `text` so share targets treat it as a link and preserve the fragment. A cancelled sheet
// rejects — nothing to report there, the link is still on screen.
const share = () => {
void navigator
.share?.({ title: 'Join the tailnet', text: `Tap to join as ${invite.user}: ${invite.url}` })
.share?.({ title: 'Join the tailnet', text: `Tap to join as ${invite.user}`, url: invite.url })
.catch(() => {});
};