aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/platform.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-23 18:05:14 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-23 18:05:14 +0200
commit35a7764db3f58a93c32206cb3ce74bb2f03967e7 (patch)
treed2acb2a07ee6dc2f4241fcc785c2860d57263892 /packages/meshbay-hub/src/meshbay_hub/static/platform.js
parent998f9c69308ee88fac36cfb77dfb6d07c6fa926a (diff)
downloadmeshbay-35a7764db3f58a93c32206cb3ce74bb2f03967e7.tar.gz
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 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/platform.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/platform.js11
1 files changed, 11 insertions, 0 deletions
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.