From 35a7764db3f58a93c32206cb3ce74bb2f03967e7 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Wed, 23 Sep 2026 18:05:14 +0200 Subject: feat(hub): open, create and join invitation links in the interface #/invite takes the link out of the address on load and keeps it in the tab through registration and sign-in; joining is one click, only the ticket goes to the hub, and the code goes only to the node the link names once it has signed its challenge. Members tab gains "Invite by link" (shared e-mail box, pending list, cancel both halves); home page takes a pasted link. Browser probe drives the real app, signed out and in. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/src/meshbay_hub/static/platform.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/platform.js b/packages/meshbay-hub/src/meshbay_hub/static/platform.js index cfa4d87..a3fb80b 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/platform.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/platform.js @@ -39,6 +39,17 @@ export function hubBase() { return bridge ? (bridge.hubBase() || '') : ''; } +/** + * The hub's own address, as somebody else would type it — for a link that is + * sent to another person, where "same origin" means nothing. In a browser the + * hub served this page, so it is the page's origin; in the app it is the + * configured hub. Decided here and nowhere else, like `hubBase()`. + */ +export function hubOrigin() { + const base = hubBase(); + return (base ? new URL(base).origin : window.location.origin); +} + /** Native-only capabilities. A browser renders none of what these gate. */ export const capabilities = { // Install, configure and drive a node running on this machine. -- cgit v1.2.3