summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/ops.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-01 11:07:05 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-01 11:07:05 +0200
commit0443cf8aaab58a54c73d28cafca5d5d8a52605e6 (patch)
tree6516fe97240a02c086e1a6b5c1d11313e1555520 /packages/meshbay-node/src/meshbay_node/ops.py
parentb6c15f35d570d4f54901b811654991847502ca82 (diff)
downloadmeshbay-0443cf8aaab58a54c73d28cafca5d5d8a52605e6.tar.gz
fix(node): CLI member invite now registers hub membership and enforces code
Two bugs fixed: 1. `meshbay-node member invite <user>` created a local roster invite but never told the hub to add the user to group_members, so the group was invisible in the SPA. The node now calls POST /v1/groups/{id}/members/{username} after creating the invite, and the hub endpoint accepts node-scoped tokens (the admin_id check is the real authorization guard). 2. The WebRTC handshake let a previously-pinned user reconnect without a code even when a new invite was pending (e.g. after leave + re-invite). Now any pending invite forces code entry, regardless of existing member/pin status. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/ops.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/ops.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/ops.py b/packages/meshbay-node/src/meshbay_node/ops.py
index 34a569f..6d53edb 100644
--- a/packages/meshbay-node/src/meshbay_node/ops.py
+++ b/packages/meshbay-node/src/meshbay_node/ops.py
@@ -190,6 +190,14 @@ async def create_invite(state: dict, group_id: str, username: str, *,
ttl=ttl,
username=username,
)
+
+ hub = _hub(state)
+ try:
+ await hub.add_group_member(group_id, username)
+ except Exception:
+ log.warning("Could not register %s as hub member of %s",
+ username, group_id[:8])
+
invites = await roster.list_invites()
expires = next((i["expires_at"] for i in invites
if i["user_id"] == user_id